# CLI Reference

Run the following to list all available Bit commands (alternatively, use the `-h` alias, instead of `--help`):

```sh
bit --help
```

Run the following to get help on a specific command:

```sh
bit COMMAND --help
```

Run the following to get help on a specific sub-command:

```sh
bit COMMAND SUB_COMMAND --help
```

## add

**Alias**: `a`  
**Description**: track existing directory contents as new components in the workspace  
Registers one or more directories as Bit components without changing your files. Each provided path becomes a component root tracked by Bit.

`bit add [path...]`

| **Option**                | **Option alias** | **Description**                                                                                 |
| ------------------------- | :--------------: | ----------------------------------------------------------------------------------------------- |
| `--id <name>`             |       `-i`       | manually set component id                                                                       |
| `--main <file>`           |       `-m`       | define component entry point                                                                    |
| `--namespace <namespace>` |       `-n`       | organize component in a namespace                                                               |
| `--override <boolean>`    |       `-o`       | override existing component if exists (default = false)                                         |
| `--scope <string>`        |       `-s`       | sets the component's scope. if not entered, the default-scope from workspace.jsonc will be used |
| `--env <string>`          |       `-e`       | set the component's environment. (overrides the env from variants if exists)                    |
| `--json`                  |       `-j`       | output as json format                                                                           |

---

## app

**Alias**: `apps`  
**Description**: manage application components  
applications are components that create deployable, runnable applications like React apps or Node.js servers.  
list available apps in the workspace and inspect their configurations.  
use "bit run" to start an application locally.

`bit app [sub-command]`

### app list

**Usage**: `app list`

**Description**: list all registered apps

| **Option** | **Option alias** | **Description**                          |
| ---------- | :--------------: | ---------------------------------------- |
| `--json`   |       `-j`       | return the component data in json format |

### app run

**Usage**: `app run [app-name]`

**Description**: start an application component locally  
runs application components in their own development server, separate from the "bit start" UI.  
apps are components that create deployable applications (React apps, Node.js servers, etc.).  
when no app name is specified, automatically detects and runs the app if only one exists in the workspace.

| **Arg**    |                                           **Description**                                            |
| ---------- | :--------------------------------------------------------------------------------------------------: |
| `app-name` | the app's name is registered by the app (run 'bit app list' to list the names of the available apps) |

| **Option**             | **Option alias** | **Description**                                                                                                                               |
| ---------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `--dev`                |       `-d`       | start the application in dev mode.                                                                                                            |
| `--port [port-number]` |       `-p`       | port to run the app on                                                                                                                        |
| `--verbose`            |       `-v`       | show verbose output for inspection and print stack trace                                                                                      |
| `--watch`              |       `-w`       | watch and compile your components upon changes                                                                                                |
| `--no-browser`         |       `-n`       | do not automatically open browser when ready                                                                                                  |
| `--args <argv>`        |       `-a`       | the arguments passing to the app. for example, --args="--a=1 --b". don't forget to use quotes to wrap the value to escape special characters. |

---

## artifacts

**Description**: view and download build artifacts  
displays artifacts created during the build pipeline in isolated capsules during tag or snap operations.  
artifacts include compiled files, test reports, package files, and other build outputs generated by various tasks.  
use --out-dir to download artifacts locally for inspection or deployment purposes.

`bit artifacts <component-pattern>`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**             | **Option alias** | **Description**                                                                                          |
| ---------------------- | :--------------: | -------------------------------------------------------------------------------------------------------- |
| `--aspect <aspect-id>` |                  | show/download only artifacts generated by this aspect-id                                                 |
| `--task <task-id>`     |                  | show/download only artifacts generated by this task-id                                                   |
| `--files <glob>`       |                  | show/download only artifacts matching the given files or the glob pattern (wrap glob patterns in quotes) |
| `--out-dir <string>`   |                  | download the files to the specified dir                                                                  |

---

## aspect

**Description**: manage component aspects and their configurations  
aspects provide functionality and tools for components throughout their development lifecycle.  
primarily useful for inspecting aspect assignments and configurations with "bit aspect get".  
rarely used for manual aspect management as most aspects are configured automatically.

`bit aspect <sub-command>`

### aspect list

**Usage**: `aspect list [pattern]`

**Description**: list all aspects configured on component(s)

| **Arg**   |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| --------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option** | **Option alias** | **Description**                                    |
| ---------- | :--------------: | -------------------------------------------------- |
| `--debug`  |       `-d`       | show the origins where the aspects were taken from |

### aspect list-core

**Usage**: `aspect list-core`

**Description**: list all core aspects

| **Arg**   |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| --------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | format as json  |

### aspect get

**Usage**: `aspect get <component-name>`

**Description**: list the aspects set on a component, as well as their configs and data

| **Arg**          |                     **Description**                     |
| ---------------- | :-----------------------------------------------------: |
| `component-name` | the component name or component id to fetch aspects for |

| **Option** | **Option alias** | **Description**                                    |
| ---------- | :--------------: | -------------------------------------------------- |
| `--debug`  |       `-d`       | show the origins where the aspects were taken from |
| `--json`   |       `-j`       | format as json                                     |

### aspect set

**Usage**: `aspect set <pattern> <aspect-id> [config]`

**Description**: set components with an aspect to extend their development tools, metadata and (possibly) artifacts

| **Arg**     |                                                                                                                                                                                                                              **Description**                                                                                                                                                                                                                              |
| ----------- | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `pattern`   | the components to extend. component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `aspect-id` |                                                                                                                                                                                                                         the aspect's component id                                                                                                                                                                                                                         |
| `config`    |                                                                                                                                                        the aspect config. enter the config as a stringified JSON (e.g. '{"foo":"bar"}' ). when no config is provided, an aspect is set with an empty config ({}).                                                                                                                                                         |

| **Option** | **Option alias** | **Description**                                                                                |
| ---------- | :--------------: | ---------------------------------------------------------------------------------------------- |
| `--merge`  |       `-m`       | merge with an existing config if exits. (by default, it replaces overlapping existing configs) |

### aspect unset

**Usage**: `aspect unset <pattern> <aspect-id>`

**Description**: unset an aspect from component(s).

| **Arg**     |                                                                                                                                                                                                                              **Description**                                                                                                                                                                                                                              |
| ----------- | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `pattern`   | the components to target. component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `aspect-id` |                                                                                                                                                                                                                         the aspect's component id                                                                                                                                                                                                                         |

### aspect update

**Usage**: `aspect update <aspect-id> [pattern]`

**Description**: update a version of an aspect for all or specified components

| **Arg**     |                                                                                                                                                                                                                                            **Description**                                                                                                                                                                                                                                             |
| ----------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `aspect-id` |                                                                                                                                                                                        the aspect's component id. optionally, add a version (id@version), otherwise will use the latest version from the remote                                                                                                                                                                                        |
| `pattern`   | the components to update (defaults to all components). component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

---

## blame

**Description**: EXPERIMENTAL. show line-by-line authorship and modification history  
displays who last modified each line of a file and when the change was made.  
tracks line-level changes across component versions.  
shows author, date, version hash, and optionally commit messages for each line.

`bit blame <filepath>`

| **Arg**    |           **Description**           |
| ---------- | :---------------------------------: |
| `filepath` | file path relative to the workspace |

| **Option**          | **Option alias** | **Description**         |
| ------------------- | :--------------: | ----------------------- |
| `--include-message` |       `-m`       | show the commit message |

---

## build

**Description**: run build pipeline tasks in isolated environments  
executes the complete build pipeline including compilation, testing, linting, and other tasks defined by component environments.  
the build takes place in isolated directories called "capsules" where component files are copied and dependencies are installed via the package manager.  
by default processes only new and modified components - use --unmodified to build all components.  
because this process can take a while on large workspaces, various flags are available to optimize the process - see examples for debugging workflows.

`bit build [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                         | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--unmodified`                     |       `-u`       | include unmodified components (by default, only new and modified components are built)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `--dev`                            |       `-d`       | run the pipeline in dev mode                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--install`                        |                  | install core aspects in capsules                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `--reuse-capsules`                 |                  | avoid deleting the capsules root-dir before starting the build                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `--rewrite`                        |                  | use only with --reuse-capsules. rewrite the component files                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `--reinstall`                      |                  | use only with --reuse-capsules. rerun the installation                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `--tasks <string>`                 |                  | build the specified task(s) only. for multiple tasks, separate by a comma and wrap with quotes. specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `--cache-packages-on-capsule-root` |                  | set the package-manager cache on the capsule root                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `--list-tasks <string>`            |                  | list tasks of an env or a component-id for each one of the pipelines: build, tag and snap                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| `--skip-tests`                     |                  | skip running component tests during build process                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `--loose`                          |                  | allow build to succeed even if tasks like tests or lint fail                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--skip-tasks <string>`            |                  | skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes. specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--fail-fast`                      |                  | stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--include-snap`                   |                  | include snap pipeline tasks. Warning: this may deploy/publish if you have such tasks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `--include-tag`                    |                  | include tag pipeline tasks. Warning: this may deploy/publish if you have such tasks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `--ignore-issues <issues>`         |       `-i`       | ignore component issues (shown in "bit status" as "issues found"), issues to ignore: [MissingPackagesDependenciesOnFs, MissingManuallyConfiguredPackages, UntrackedDependencies, ResolveErrors, RelativeComponents, RelativeComponentsAuthored, ParseErrors, MissingDists, LegacyInsideHarmony, MissingDependenciesOnFs, ImportNonMainFiles, MultipleEnvs, MissingLinksFromNodeModulesToSrc, CircularDependencies, DuplicateComponentAndPackage, MergeConfigHasConflict, NonLoadedEnv, ExternalEnvWithoutVersion, RemovedDependencies, RemovedEnv, DeprecatedDependencies, SelfReference, ImportFromDirectory] to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "\*". |

---

## capsule

**Description**: manage isolated component environments  
capsules are temporary isolated directories containing component code and dependencies.  
automatically created during build processes to compile and test components in isolation.  
ensures components work independently before publishing, similar to how they'll be consumed.

`bit capsule`

### capsule list

**Usage**: `capsule list`

**Description**: list the capsules generated for this workspace

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

### capsule create

**Usage**: `capsule create [component-id...]`

**Description**: create capsules for components

| **Option**                 | **Option alias** | **Description**                                                                                         |
| -------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------- |
| `--base-dir <name>`        |       `-b`       | set base dir of all capsules (hashed to create the base dir inside the root dir - host path by default) |
| `--root-base-dir <name>`   |       `-r`       | set root base dir of all capsules (absolute path to use as root dir)                                    |
| `--always-new`             |       `-a`       | create new environment for capsule                                                                      |
| `--seeders-only`           |       `-s`       | create capsules for the seeders only (not for the entire graph)                                         |
| `--id <name>`              |       `-i`       | reuse capsule of certain name                                                                           |
| `--use-hash`               |                  | whether to use hash function (of base dir) as capsules root dir name                                    |
| `--json`                   |       `-j`       | json format                                                                                             |
| `--install-packages`       |       `-d`       | install packages by the package-manager                                                                 |
| `--package-manager <name>` |       `-p`       | npm, yarn or pnpm, default to npm                                                                       |

### capsule delete

**Usage**: `capsule delete`

**Description**: delete capsules  
with no args, only workspace's capsules are deleted

| **Option**        | **Option alias** | **Description**                                   |
| ----------------- | :--------------: | ------------------------------------------------- |
| `--scope-aspects` |                  | delete scope-aspects capsules                     |
| `--all`           |       `-a`       | delete all capsules for all workspaces and scopes |

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

---

## check-types

**Description**: validate TypeScript type correctness  
checks for TypeScript type errors in component files, similar to running tsc.  
by default only checks new and modified components. use --unmodified to check all components.  
useful for catching type issues before tagging, snapping or building components.

`bit check-types [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**     | **Option alias** | **Description**                                           |
| -------------- | :--------------: | --------------------------------------------------------- |
| `--all`        |       `-a`       | DEPRECATED. (use --unmodified)                            |
| `--unmodified` |       `-u`       | check-types for all components, not only modified and new |
| `--strict`     |                  | in case issues found, exit with code 1                    |
| `--json`       |       `-j`       | return the output in json format                          |

---

## checkout

**Alias**: `U`  
**Description**: switch between component versions or remove local changes  
checkout components to specified versions or remove local changes. most commonly used as 'bit checkout head' to get latest versions.  
the `<to>` argument accepts these values:

- head: checkout to last snap/tag (most common usage)
- specific version: checkout to exact version (e.g. 'bit checkout 1.0.5 component-name')
- head~x: go back x generations from head (e.g. 'head~2' for two versions back)
- latest: checkout to latest semver tag
- reset: remove local modifications and restore original files (also restores deleted component directories)  
  when on lanes, 'checkout head' only affects lane components. to update main components, run 'bit lane merge main'.

`bit checkout <to> [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `to`                |                                                                                                                                          permitted values: [head, latest, reset, {specific-version}, {head~x}]. 'head' - last snap/tag. 'latest' - semver latest tag. 'reset' - removes local changes                                                                                                                                           |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                              | **Option alias** | **Description**                                                                                                                          |
| --------------------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `--interactive-merge`                   |       `-i`       | when a component is modified and the merge process found conflicts, display options to resolve them                                      |
| `--auto-merge-resolve <merge-strategy>` |       `-r`       | in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]                                            |
| `--manual`                              |                  | same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers                              |
| `--all`                                 |       `-a`       | all components                                                                                                                           |
| `--workspace-only`                      |       `-e`       | only relevant for 'bit checkout head' when on a lane. don't import components from the remote lane that are not already in the workspace |
| `--verbose`                             |       `-v`       | showing verbose output for inspection                                                                                                    |
| `--skip-dependency-installation`        |       `-x`       | do not auto-install dependencies of the imported components                                                                              |
| `--force-ours`                          |                  | do not merge, preserve local files as is                                                                                                 |
| `--force-theirs`                        |                  | do not merge, just overwrite with incoming files                                                                                         |

---

## ci

**Description**: continuous integration commands for automated workflows  
provides commands designed for use in CI/CD pipelines with Git workflows to automate component development tasks like verification, pull request handling, and deployment preparation.

`bit ci <sub-command>`

### ci verify

**Usage**: `ci verify`

**Description**: Ensures the workspace passes CI checks on every commit.  
Runs lint, build, and status checks to catch dependency drift or broken builds early. Typically used as a pre-push hook or early CI job. Stops at the first failing step and returns a non-zero exit code.

### ci pr

**Usage**: `ci pr`

**Description**: Exports a feature lane to Bit Cloud when a Pull Request is opened or updated.  
Resolves the lane name from --lane or the current Git branch, validates it, and runs install, status, snap, and export. Cleans up by switching back to main. Use in pull-request CI pipelines after tests and before deploy.

| **Option**            | **Option alias** | **Description**                                                                         |
| --------------------- | :--------------: | --------------------------------------------------------------------------------------- |
| `--message <message>` |       `-m`       | If set, set it as the snap message, if not, try and grab from git-commit-message        |
| `--lane <lane>`       |       `-l`       | If set, use as the lane name, if not available, grab from git-branch name               |
| `--build`             |       `-b`       | Set to true to build the app locally, false (default) will build on Ripple CI           |
| `--strict`            |       `-s`       | Set to true to fail on warnings as well as errors, false (default) only fails on errors |

### ci merge

**Usage**: `ci merge`

**Description**: Tags and exports new semantic versions after merging a PR to main.  
By default, bumps patch versions when merging to main. If specific configuration variables are set, it can use commit messages or explicit flags to determine the version bump. Runs install, tag, build, and export, then archives the remote lane and syncs lockfiles. Use in merge-to-main CI pipelines to publish releases.

| **Option**                              | **Option alias** | **Description**                                                                                               |
| --------------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------- |
| `--message <message>`                   |       `-m`       | If set, use it as the tag message, if not, try and grab from git-commit-message                               |
| `--build`                               |       `-b`       | Set to true to build the app locally, false (default) will build on Ripple CI                                 |
| `--strict`                              |       `-s`       | Set to true to fail on warnings as well as errors, false (default) only fails on errors                       |
| `--increment <level>`                   |       `-l`       | options are: [major, premajor, minor, preminor, patch, prepatch, prerelease], default to patch                |
| `--prerelease-id <id>`                  |                  | prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")                                                       |
| `--patch`                               |       `-p`       | syntactic sugar for "--increment patch"                                                                       |
| `--minor`                               |                  | syntactic sugar for "--increment minor"                                                                       |
| `--major`                               |                  | syntactic sugar for "--increment major"                                                                       |
| `--pre-release [identifier]`            |                  | syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`                               |
| `--increment-by <number>`               |                  | (default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.    |
| `--versions-file <path>`                |                  | path to a file containing component versions. format: "component-id: version"                                 |
| `--verbose`                             |                  | show verbose output                                                                                           |
| `--auto-merge-resolve <merge-strategy>` |       `-r`       | in case of merge conflict during checkout, resolve according to the provided strategy: [ours, theirs, manual] |
| `--force-theirs`                        |                  | do not merge during checkout, just overwrite with incoming files                                              |
| `--lane-name <name>`                    |                  | specify the lane name to delete after merge (auto-detected if not provided)                                   |

---

## clear-cache

**Alias**: `cc`  
**Description**: remove cached data to resolve stale data issues  
clears various caches that Bit uses to improve performance. useful when experiencing stale data issues or  
unexpected behavior. this command removes:

1. components cache on the filesystem (mainly the dependencies graph and docs)
2. scope's index file, which maps the component-id:object-hash

note: this cache has minimal impact on disk space. to free significant disk space, use "bit capsule delete --all" to remove build capsules.

`bit clear-cache`

| **Option**               | **Option alias** | **Description**                        |
| ------------------------ | :--------------: | -------------------------------------- |
| `--remote <remote-name>` |       `-r`       | clear memory cache from a remote scope |

---

## compile

**Description**: transpile component source files  
compiles TypeScript, JSX, and other source files into JavaScript using the compiler configured by each component's environment.  
outputs compiled files to node_modules/component-package-name/dist for consumption by other components.  
automatically triggered by "bit watch", "bit start", or IDE extensions, but can be run manually for debugging.

`bit compile [component-names...]`

| **Arg**              |                             **Description**                             |
| -------------------- | :---------------------------------------------------------------------: |
| `component-names...` | a list of component names or component IDs (defaults to all components) |

| **Option**          | **Option alias** | **Description**                                                                 |
| ------------------- | :--------------: | ------------------------------------------------------------------------------- |
| `--changed`         |       `-c`       | compile only new and modified components                                        |
| `--verbose`         |       `-v`       | show more data, such as, dist paths                                             |
| `--json`            |       `-j`       | return the compile results in json format                                       |
| `--delete-dist-dir` |       `-d`       | delete existing dist folder before writing new compiled files                   |
| `--generate-types`  |                  | EXPERIMENTAL. generate d.ts files for typescript components (hurts performance) |

---

## config

**Description**: manage Bit configuration settings  
view and modify Bit configuration at different levels: global, workspace, or scope.  
configurations control various aspects of Bit including user settings, registries, and feature flags.  
use environment variables prefixed with BIT*CONFIG* for temporary overrides.  
https://bit.dev/reference/config/bit-config

`bit config`

### config set

**Usage**: `config set <key> <val>`

**Description**: set a configuration. default to save it globally  
to set temporary configuration by env variable, prefix with "BIT*CONFIG", replace "." with "*" and change to upper case.  
for example, "user.token" becomes "BIT_CONFIG_USER_TOKEN"

| **Option**      | **Option alias** | **Description**                                                           |
| --------------- | :--------------: | ------------------------------------------------------------------------- |
| `--local`       |       `-l`       | set the configuration in the current scope (saved in .bit/scope.json)     |
| `--local-track` |       `-t`       | set the configuration in the current workspace (saved in workspace.jsonc) |

### config del

**Usage**: `config del <key>`

**Description**: delete given key from global configuration

| **Option**          | **Option alias** | **Description**                                                                                                          |
| ------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------ |
| `--origin <origin>` |       `-o`       | default to delete whenever it found first. specify to delete specifically from the following: [scope, workspace, global] |

### config get

**Usage**: `config get <key>`

**Description**: get a value from global configuration

### config list

**Usage**: `config list`

**Description**: list all configuration(s)

| **Option**          | **Option alias** | **Description**                                                                |
| ------------------- | :--------------: | ------------------------------------------------------------------------------ |
| `--origin <origin>` |       `-o`       | list configuration specifically from the following: [scope, workspace, global] |
| `--detailed`        |       `-d`       | list all configuration(s) with the origin                                      |
| `--json`            |       `-j`       | output as JSON                                                                 |

---

## create

**Description**: scaffold new component(s) from a template (sources, config, and env)  
Generates one or more components from a chosen template with ready-to-use source files, configuration, and environment. Use it to quickly scaffold consistent components across your workspace. Run 'bit templates' to discover available templates.

`bit create <template-name> <component-names...>`

| **Arg**              |                                          **Description**                                          |
| -------------------- | :-----------------------------------------------------------------------------------------------: |
| `template-name`      | the template for generating the component (run 'bit templates' for a list of available templates) |
| `component-names...` |                               a list of component names to generate                               |

| **Option**             | **Option alias** | **Description**                                                                     |
| ---------------------- | :--------------: | ----------------------------------------------------------------------------------- |
| `--namespace <string>` |       `-n`       | sets the component's namespace and nested dirs inside the scope                     |
| `--scope <string>`     |       `-s`       | sets the component's scope-name. if not entered, the default-scope will be used     |
| `--aspect <string>`    |       `-a`       | aspect-id of the template. helpful when multiple aspects use the same template name |
| `--template <string>`  |       `-t`       | env-id of the template. alias for --aspect.                                         |
| `--path <string>`      |       `-p`       | relative path in the workspace. by default the path is `<scope>/<namespace>/<name>` |
| `--env <string>`       |       `-e`       | set the component's environment. (overrides the env from variants and the template) |
| `--force`              |       `-f`       | replace existing files at the target location                                       |

---

## delete

**Description**: soft-delete components from remote scopes  
marks components as deleted so they won't be visible on remote scopes after export.  
components remain recoverable using "bit recover" unless --hard is used (permanent deletion, not recommended).  
to remove components from your local workspace only, use "bit remove" instead.

`bit delete <component-pattern>`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**         | **Option alias** | **Description**                                                                                                                                             |
| ------------------ | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--lane`           |                  | when on a lane, delete the component from this lane only. this removal will not affect main when the lane is merged                                         |
| `--update-main`    |                  | delete component/s on the main lane after merging this lane into main                                                                                       |
| `--range <string>` |                  | EXPERIMENTAL. enter a Semver range to delete specific tags (cannot be used for snaps). see https://www.npmjs.com/package/semver#ranges for the range syntax |
| `--silent`         |       `-s`       | skip confirmation                                                                                                                                           |
| `--hard`           |                  | NOT-RECOMMENDED. delete a component completely from a remote scope. careful! this is a permanent change that could corrupt dependents.                      |
| `--force`          |       `-f`       | relevant for --hard. allow the deletion even if used as a dependency. WARNING: components that depend on this component will corrupt                        |
| `--snaps <string>` |                  | comma-separated list of snap hashes to mark as deleted (e.g. --snaps "hash1,hash2,hash3")                                                                   |

---

## dependents

**Description**: show components that depend on the specified component  
displays components from both workspace and scope that depend on the specified component.  
useful for understanding impact before making changes to a component or when planning refactoring.  
shows both direct and transitive dependents organized by their origin (workspace vs scope).

`bit dependents <component-name>`

| **Arg**          |        **Description**         |
| ---------------- | :----------------------------: |
| `component-name` | component name or component id |

| **Option** | **Option alias** | **Description**                      |
| ---------- | :--------------: | ------------------------------------ |
| `--json`   |       `-j`       | return the dependents in JSON format |

---

## deprecate

**Alias**: `d`  
**Description**: mark a component as deprecated to discourage its use  
marks a component as deprecated locally, then after snap/tag and export it becomes deprecated in the remote scope.  
optionally specify a replacement component or deprecate only specific version ranges.  
deprecated components remain available but display warnings when installed or imported.

`bit deprecate <component-name>`

| **Arg**          |        **Description**         |
| ---------------- | :----------------------------: |
| `component-name` | component name or component id |

| **Option**          | **Option alias** | **Description**                                                                                                                   |
| ------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------- |
| `--new-id <string>` |                  | if replaced by another component, enter the new component id. alternatively use "bit rename --deprecate" to do this automatically |
| `--range <string>`  |                  | enter a Semver range to deprecate specific versions. see https://www.npmjs.com/package/semver#ranges for the range syntax         |

---

## deps

**Alias**: `dependencies`  
**Description**: manage component dependencies  
configure and analyze component dependencies with sub-commands for setting, removing, and inspecting dependency relationships.

`bit deps <sub-command>`

### deps get

**Usage**: `deps get <component-name>`

**Description**: show direct and indirect dependencies of the given component

| **Arg**          |        **Description**         |
| ---------------- | :----------------------------: |
| `component-name` | component name or component id |

| **Option** | **Option alias** | **Description**                                      |
| ---------- | :--------------: | ---------------------------------------------------- |
| `--scope`  |                  | get the data from the scope instead of the workspace |
| `--tree`   |       `-t`       | render dependencies as a tree, similar to "npm ls"   |

### deps remove

**Usage**: `deps remove <component-pattern> <package...>`

**Description**: remove a dependency from one or more components  
this command removes the dependency whether it was set by 'bit deps set'/variants or by auto-detection.  
if the dependency was auto-detected, it will be marked with a minus sign in the .bitmap file.  
otherwise, the config is written to .bitmap without the dependency.  
see also 'bit deps unset'

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `package...`        |                                                                                                                                                       package name with or without a version, e.g. "lodash@1.0.0" or just "lodash" which will remove all lodash instances of any version                                                                                                                                                        |

| **Option** | **Option alias** | **Description**              |
| ---------- | :--------------: | ---------------------------- |
| `--dev`    |       `-d`       | remove from devDependencies  |
| `--peer`   |       `-p`       | remove from peerDependencies |

### deps unset

**Usage**: `deps unset <component-pattern> <package...>`

**Description**: unset a dependency to component(s) that was set via config (e.g. "bit deps set" or variants)  
this command removes the dependency only when it was set by config not if it was auto detected.  
in the .bitmap file, the config is written without the dependency.  
see also "bit deps remove"

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `package...`        |                                                                                                                                                       package name with or without a version, e.g. "lodash@1.0.0" or just "lodash" which will remove all lodash instances of any version                                                                                                                                                        |

| **Option** | **Option alias** | **Description**             |
| ---------- | :--------------: | --------------------------- |
| `--dev`    |       `-d`       | unset from devDependencies  |
| `--peer`   |       `-p`       | unset from peerDependencies |

### deps debug

**Usage**: `deps debug <component-name>`

**Description**: show the immediate dependencies and how their versions were determined

| **Arg**          |        **Description**         |
| ---------------- | :----------------------------: |
| `component-name` | component name or component id |

### deps set

**Usage**: `deps set <component-pattern> <package...>`

**Description**: set a dependency to component(s)

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `package...`        |                                                                                                                                                                package name with or without a version, e.g. "lodash@1.0.0" or just "lodash" which will be resolved to the latest                                                                                                                                                                |

| **Option**   | **Option alias** | **Description**                 |
| ------------ | :--------------: | ------------------------------- |
| `--dev`      |       `-d`       | add to the devDependencies      |
| `--optional` |       `-o`       | add to the optionalDependencies |
| `--peer`     |       `-p`       | add to the peerDependencies     |

### deps reset

**Usage**: `deps reset <component-pattern>`

**Description**: reset dependencies to the default values (revert any previously "bit deps set")

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### deps eject

**Usage**: `deps eject <component-pattern>`

**Description**: write dependencies that were previously set via "bit deps set" into .bitmap

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### deps blame

**Usage**: `deps blame <component-name> <dependency-name>`

**Description**: find out which snap/tag changed a dependency version

| **Arg**           |                                **Description**                                |
| ----------------- | :---------------------------------------------------------------------------: |
| `dependency-name` | package-name. for components, you can use either component-id or package-name |

### deps usage

**Usage**: `deps usage <dependency-name>`

**Description**: find components that use the specified dependency  
searches workspace components to find which ones depend on the specified package or component.  
useful for understanding dependency usage before removing packages or when refactoring components.  
supports both exact version matching and package name patterns.

| **Arg**           |                                                               **Description**                                                                |
| ----------------- | :------------------------------------------------------------------------------------------------------------------------------------------: |
| `dependency-name` | package-name. for components, you can use either component-id or package-name. if version is specified, it will search for the exact version |

| **Option**         | **Option alias** | **Description**                           |
| ------------------ | :--------------: | ----------------------------------------- |
| `--depth <number>` |                  | max display depth of the dependency graph |

### deps write

**Usage**: `deps write`

**Description**: write all workspace component dependencies to package.json or workspace.jsonc, resolving conflicts by picking the ranges that match the highest versions

| **Option**                 | **Option alias** | **Description** |
| -------------------------- | :--------------: | --------------- | ---------------------------------------------------------------------------------------------- |
| `--target <workspace.jsonc |  package.json>`  |                 | specify where the dependencies should be written. By default they are saved to workspace.jsonc |

---

## diff

**Description**: compare component changes between versions or against the current workspace  
shows a detailed diff of component files, dependencies, and configuration changes.  
by default, compares workspace changes against the latest version. specify versions to compare historical changes.  
supports pattern matching to filter components and various output formats for better readability.

`bit diff [component-pattern] [version] [to-version]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `version`           |                                                                                                                                                             the base version to compare from. if omitted, compares the workspace's current files to the component's latest version.                                                                                                                                                             |
| `to-version`        |                                                                                                                                         the target version to compare against "version". if both "version" and "to-version" are provided, compare those two versions directly (ignoring the workspace).                                                                                                                                         |

| **Option**  | **Option alias** | **Description**                                                                                 |
| ----------- | :--------------: | ----------------------------------------------------------------------------------------------- |
| `--parent`  |       `-p`       | compare the specified "version" to its immediate parent instead of comparing to the current one |
| `--verbose` |       `-v`       | show a more verbose output where possible                                                       |
| `--table`   |       `-t`       | show tables instead of plain text for dependencies diff                                         |

---

## doctor

**Description**: diagnose and troubleshoot workspace issues  
runs comprehensive health checks on your workspace to detect and report configuration problems,  
missing dependencies, corrupted data, and other issues that may affect workspace functionality.  
can generate diagnostic reports and workspace archives for debugging and support purposes.

`bit doctor [diagnosis-name]`

| **Option**               | **Option alias** | **Description**                                                                                   |
| ------------------------ | :--------------: | ------------------------------------------------------------------------------------------------- |
| `--json`                 |       `-j`       | return diagnoses in json format                                                                   |
| `--list`                 |                  | list all available diagnoses                                                                      |
| `--save [filePath]`      |       `-s`       | save diagnoses to a file                                                                          |
| `--archive [filePath]`   |       `-a`       | archive the workspace including diagnosis info (by default exclude node-modules and include .bit) |
| `--include-node-modules` |       `-n`       | relevant for --archive. include node_modules in the archive file                                  |
| `--include-public`       |       `-p`       | relevant for --archive. include public folder in the archive file                                 |
| `--exclude-local-scope`  |       `-e`       | relevant for --archive. exclude .bit or .git/bit from the archive file                            |
| `--remote <remoteName>`  |       `-r`       | run doctor checks on a remote scope                                                               |

---

## eject

**Alias**: `E`  
**Description**: remove component from workspace and install it as npm package  
converts workspace components to external npm packages by removing them from .bitmap and installing via package manager.  
by default removes component files from workspace. use --keep-files to preserve source code while converting to package dependency.  
useful for components that no longer need active development in current workspace.

`bit eject <component-pattern>`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                       | **Option alias** | **Description**                                                                                                                  |
| -------------------------------- | :--------------: | -------------------------------------------------------------------------------------------------------------------------------- |
| `--force`                        |       `-f`       | ignore local changes/versions. eject component/s even when they are staged or modified. Note: unexported tags/snaps will be lost |
| `--skip-dependency-installation` |       `-x`       | do not auto-install dependencies                                                                                                 |
| `--json`                         |       `-j`       | print the results in JSON format                                                                                                 |
| `--keep-files`                   |                  | keep the component files in the workspace intact                                                                                 |

---

## eject-conf

**Description**: create component.json configuration files for components  
generates component.json files containing component-specific configuration that overrides workspace defaults.  
useful for customizing individual component settings. alternatively, use commands like "bit env set", "bit deps set", or "bit aspect set".  
can be reversed by deleting the component.json file and snapping/tagging the changes.

you can use a `<pattern>` for multiple component ids, such as `bit eject-conf "org.scope/utils/**"`.  
use comma to separate patterns and '!' to exclude. e.g. 'ui/\*\*, !ui/button'  
use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'.  
always wrap the pattern with single quotes to avoid collision with shell commands.  
use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.

`bit eject-conf <pattern>`

| **Option**    | **Option alias** | **Description**                                                                                             |
| ------------- | :--------------: | ----------------------------------------------------------------------------------------------------------- |
| `--propagate` |       `-p`       | mark propagate true in the config file, so that component.json configs will be merge with workspace configs |
| `--override`  |       `-o`       | override file if exist                                                                                      |

---

## envs

**Alias**: `env`  
**Description**: show components and their assigned environments  
displays a table showing each workspace component and its corresponding environment.  
environments control how components are built, tested, linted, and deployed.

`bit envs`

### envs list

**Usage**: `envs list`

**Description**: list all envs currently used in the workspace

### envs get

**Usage**: `envs get <component-name>`

**Description**: show config information from a component's env

| **Arg**          |                                     **Description**                                     |
| ---------------- | :-------------------------------------------------------------------------------------: |
| `component-name` | the 'component name' or 'component id' of the component whose env you'd like to inspect |

| **Option**            | **Option alias** | **Description**                                                                                                    |
| --------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------ |
| `--services <string>` |                  | show information about the specific services only. for multiple services, separate by a comma and wrap with quotes |

### envs set

**Usage**: `envs set <component-pattern> <env>`

**Description**: Assigns one or more components a development environment (env)

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `env`               |                                                                                                                                                                  the env's component id (include version if not latest, e.g `teambit.community/envs/community-react@1.95.13`)                                                                                                                                                                   |

### envs unset

**Usage**: `envs unset <component-pattern>`

**Description**: un-sets an env from components that were previously set by "bit env set" or by a component template  
keep in mind that this doesn't remove envs that are set via variants.  
in only removes envs that appear in the .bitmap file, which were previously configured via "bit env set".  
the purpose of this command is to reset previously assigned envs to either allow variants configure the env or use the base node env.  
you can use a `<pattern>` for multiple component ids, such as `bit env unset "org.scope/utils/**"`.  
use comma to separate patterns and '!' to exclude. e.g. 'ui/\*\*, !ui/button'  
use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'.  
always wrap the pattern with single quotes to avoid collision with shell commands.  
use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### envs replace

**Usage**: `envs replace <current-env> <new-env>`

**Description**: replace an existing env with another env for all components using the old env

| **Arg**       |              **Description**               |
| ------------- | :----------------------------------------: |
| `current-env` | the component id of the env to be replaced |
| `new-env`     |      the component id of the new env       |

### envs update

**Usage**: `envs update [env-id] [pattern]`

**Description**: update a version of an env for all components using that env

| **Arg**   |                                                                                                                                                                                                                                            **Description**                                                                                                                                                                                                                                             |
| --------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `env-id`  |                                                                                                                                                                        the environment id (defaults to all envs). optionally, add a version (id@version), if no version is supplied will use the latest version on the remote.                                                                                                                                                                         |
| `pattern` | the components to update (defaults to all components). component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

---

## export

**Alias**: `e`  
**Description**: upload components to remote scopes  
uploads staged versions (snaps/tags) to remote scopes, making them available for consumption by other workspaces.  
without arguments, exports all staged components. when on a lane, exports the lane as well.  
exporting is the final step after development and versioning to share components with your team.

`bit export [component-patterns...]`

| **Arg**                 |                                                                                                                                                                                                                          **Description**                                                                                                                                                                                                                          |
| ----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-patterns...` | (not recommended) component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                   | **Option alias** | **Description**                                                                                                           |
| ---------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------- |
| `--eject`                    |       `-e`       | after export, remove the components from the workspace and install them as packages                                       |
| `--all`                      |       `-a`       | export all components, including non-staged (useful when components in the remote scope are corrupted or missing)         |
| `--all-versions`             |                  | export not only staged versions but all of them (useful when versions in the remote scope are corrupted or missing)       |
| `--origin-directly`          |                  | avoid export to the central hub, instead, export directly to the original scopes. not recommended!                        |
| `--resume <string>`          |                  | in case the previous export failed and suggested to resume with an export-id, enter the id                                |
| `--head-only`                |                  | in case previous export failed and locally it shows exported and only one snap/tag was created, try using this flag       |
| `--ignore-missing-artifacts` |                  | don't throw an error when artifact files are missing. not recommended, unless you're sure the artifacts are in the remote |
| `--fork-lane-new-scope`      |                  | allow exporting a forked lane into a different scope than the original scope                                              |
| `--open-browser`             |                  | open a browser once the export is completed in the cloud job url                                                          |
| `--verbose`                  |                  | per exported component, show the versions being exported                                                                  |
| `--json`                     |       `-j`       | show output in json format                                                                                                |

---

## fork

**Description**: create a new component by copying from an existing one  
duplicates an existing component's source files and configuration to create a new independent component.  
useful for creating variations or starting development from a similar component.  
automatically handles import/require statement updates and provides refactoring options.

when using a pattern, all matching components are forked with the same name to a target scope.  
the target-component-name argument is not allowed when using patterns.

`bit fork <pattern> [target-component-name]`

| **Arg**                 |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `pattern`               | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `target-component-name` |                                                                                                                                  the name for the new component (component name without scope, e.g. name/spaces/my-button). to set a different scope, use the '--scope' flag. not allowed when using patterns                                                                                                                                   |

| **Option**                       | **Option alias** | **Description**                                                                                                     |
| -------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------- |
| `--scope <string>`               |       `-s`       | default scope for the new component                                                                                 |
| `--path <string>`                |       `-p`       | relative path in the workspace for the new component. by default the path is `<scope>/<namespace>/<name>`           |
| `--refactor`                     |       `-r`       | update the import/require statements in all dependent components (in the same workspace)                            |
| `--skip-dependency-installation` |       `-x`       | do not install packages of the imported components                                                                  |
| `--env <string>`                 |       `-e`       | set the environment for the new component                                                                           |
| `--skip-config`                  |                  | do not copy the config (aspects-config, env, etc) to the new component. helpful when it fails during aspect loading |
| `--preserve`                     |                  | avoid refactoring file and variable/class names according to the new component name                                 |
| `--no-link`                      |                  | avoid saving a reference to the original component                                                                  |
| `--ast`                          |                  | use ast to transform files instead of regex                                                                         |

---

## format

**Description**: auto-format component source code  
formats component files using the formatter configured by each component's environment (Prettier, etc.).  
by default formats all components. use --changed to format only new and modified components.  
supports check mode to verify formatting without making changes.

`bit format [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**  | **Option alias** | **Description**                                                              |
| ----------- | :--------------: | ---------------------------------------------------------------------------- |
| `--changed` |       `-c`       | format only new and modified components                                      |
| `--check`   |                  | will output a human-friendly message and a list of unformatted files, if any |
| `--json`    |       `-j`       | return the format results in json format                                     |

---

## git

**Description**: Git utilities for Bit repositories  
provides specialized Git utilities for handling Bit-specific files and conflicts.  
includes tools for setting up merge drivers for bitmap files and resolving conflicts during Git merges.  
essential for properly handling Bit's internal files when working with Git repositories.

`bit git <sub-command>`

### git set-merge-driver

**Usage**: `git set-merge-driver`

**Description**: setup bit's git merge driver for bitmap files

| **Option** | **Option alias** | **Description**                   |
| ---------- | :--------------: | --------------------------------- |
| `--global` |       `-g`       | set the git merge driver globally |

### git merge-bitmaps

**Usage**: `git merge-bitmaps <ancestor> <current> <other>`

**Description**: a special command to merge conflicting bitmap files during git merge

---

## globals

**Description**: display global directories and paths used by Bit  
shows all global directories including cache, logs, and config locations used by Bit across your system.  
useful for debugging and understanding where Bit stores data.

`bit globals`

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

---

## graph

**Description**: visualize component dependencies as a graph image  
generates an SVG (or PNG) image showing component dependency relationships.  
black arrows represent runtime dependencies, red arrows show dev or peer dependencies.  
by default shows only workspace components; use --include-dependencies for full dependency tree.

`bit graph [id]`

| **Option**               | **Option alias** | **Description**                                                                                              |
| ------------------------ | :--------------: | ------------------------------------------------------------------------------------------------------------ |
| `--remote [remoteName]`  |       `-r`       | remote name (name is optional, leave empty when id is specified)                                             |
| `--layout <name>`        |                  | GraphVis layout. default to "dot". options are [circo, dot, fdp, neato, osage, patchwork, sfdp, twopi]       |
| `--png`                  |                  | save the graph as a png file instead of svg. requires "graphviz" to be installed                             |
| `--cycles`               |                  | generate a graph of cycles only                                                                              |
| `--include-local-only`   |                  | DEPRECATED: include only the components in the workspace (or local scope). This is now the default behavior. |
| `--include-dependencies` |                  | include all dependencies recursively, not just workspace (or local scope) components                         |
| `--json`                 |       `-j`       | json format                                                                                                  |

---

## help

**Alias**: `$0`  
**Description**: display available commands and usage information  
shows a categorized list of all available Bit commands with brief descriptions. use `bit <command> --help` for detailed help on specific commands.

`bit help`

| **Option**   | **Option alias** | **Description**        |
| ------------ | :--------------: | ---------------------- |
| `--internal` |                  | show internal commands |

---

## import

**Description**: bring components from remote scopes into your workspace  
brings component source files from remote scopes into your workspace and installs their dependencies as packages.  
supports pattern matching for bulk imports, merge strategies for handling conflicts, and various optimization options.  
without arguments, fetches all workspace components' latest versions from their remote scopes.

`bit import [component-patterns...]`

| **Arg**                 |                                                                                   **Description**                                                                                   |
| ----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-patterns...` | component IDs or component patterns (separated by space). Use patterns to import groups of components using a common scope or namespace. E.g., "utils/\*" (wrap with double quotes) |

| **Option**                       | **Option alias** | **Description**                                                                                                                                                                   |
| -------------------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--path <path>`                  |       `-p`       | import components into a specific directory (a relative path in the workspace)                                                                                                    |
| `--objects`                      |       `-o`       | import components objects to the local scope without checkout (without writing them to the file system). This is the default behavior for import with no id argument              |
| `--override`                     |       `-O`       | override local changes                                                                                                                                                            |
| `--verbose`                      |       `-v`       | show verbose output for inspection                                                                                                                                                |
| `--json`                         |       `-j`       | return the output as JSON                                                                                                                                                         |
| `--skip-dependency-installation` |       `-x`       | do not auto-install dependencies of the imported components                                                                                                                       |
| `--skip-write-config-files`      |                  | do not write config files (such as eslint, tsconfig, prettier, etc...)                                                                                                            |
| `--merge [strategy]`             |       `-m`       | merge local changes with the imported version. strategy should be "theirs", "ours" or "manual"                                                                                    |
| `--dependencies`                 |                  | import all dependencies (bit components only) of imported components and write them to the workspace                                                                              |
| `--dependencies-head`            |                  | same as --dependencies, except it imports the dependencies with their head version                                                                                                |
| `--dependents`                   |                  | import components found while traversing from the imported components upwards to the workspace components                                                                         |
| `--dependents-via <string>`      |                  | same as --dependents except the traversal must go through the specified component. to specify multiple components, wrap with quotes and separate by a comma                       |
| `--dependents-all`               |                  | same as --dependents except not prompting for selecting paths but rather selecting all paths and showing final confirmation before importing                                      |
| `--dependents-dry-run`           |                  | DEPRECATED. (this is the default now). same as --dependents, except it prints the found dependents and wait for confirmation before importing them                                |
| `--silent`                       |                  | no prompt for --dependents/--dependents-via flags                                                                                                                                 |
| `--filter-envs <envs>`           |                  | only import components that have the specified environment (e.g., "teambit.react/react-env")                                                                                      |
| `--save-in-lane`                 |                  | when checked out to a lane and the component is not on the remote-lane, save it in the lane (defaults to save on main)                                                            |
| `--all-history`                  |                  | relevant for fetching all components objects. avoid optimizations, fetch all history versions, always                                                                             |
| `--fetch-deps`                   |                  | fetch dependencies (bit components) objects to the local scope, but dont add to the workspace. Useful to resolve errors about missing dependency data                             |
| `--write-deps <workspace.jsonc   |  package.json>`  |                                                                                                                                                                                   | write all workspace component dependencies to package.json or workspace.jsonc, resolving conflicts by picking the ranges that match the highest versions |
| `--track-only`                   |                  | do not write any component files, just create .bitmap entries of the imported components. Useful when the files already exist and just want to re-add the component to the bitmap |
| `--include-deprecated`           |                  | when importing with patterns, include deprecated components (default to exclude them)                                                                                             |
| `--lane-only`                    |                  | when using wildcards on a lane, only import components that exist on the lane (never from main)                                                                                   |

---

## init

**Description**: initialize a Bit workspace in an existing project  
creates Bit configuration files in an existing project directory to start tracking components.  
if already a workspace, validates and repairs Bit files as needed.  
supports various reset options to recover from corrupted state or restart from scratch.

`bit init [path]`

| **Option**                                | **Option alias** | **Description**                                                                                                                           |
| ----------------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `--name <workspace-name>`                 |       `-n`       | name of the workspace                                                                                                                     |
| `--generator <env-id>`                    |                  | for multiple, separate by a comma. add env-ids into the generators field in the workspace config for future "bit create" templates        |
| `--standalone`                            |       `-T`       | do not nest component store within .git directory and do not write config data inside package.json                                        |
| `--no-package-json`                       |                  | do not generate package.json                                                                                                              |
| `--reset`                                 |       `-r`       | write missing or damaged Bit files                                                                                                        |
| `--reset-new`                             |                  | reset .bitmap file as if the components were newly added and remove all model data (objects)                                              |
| `--reset-lane-new`                        |                  | same as reset-new, but it only resets components belong to lanes. main components are left intact                                         |
| `--reset-hard`                            |                  | delete all Bit files and directories, including Bit configuration, tracking and model data. Useful for re-starting workspace from scratch |
| `--reset-scope`                           |                  | removes local scope (.bit or .git/bit). tags/snaps that have not been exported will be lost. workspace is left intact                     |
| `--default-directory <default-directory>` |       `-d`       | set the default directory pattern to import/create components into                                                                        |
| `--default-scope <default-scope>`         |                  | set the default scope for components in the workspace                                                                                     |
| `--force`                                 |       `-f`       | force workspace initialization without clearing local objects                                                                             |
| `--bare [name]`                           |       `-b`       | initialize an empty bit bare scope                                                                                                        |
| `--shared <groupname>`                    |       `-s`       | add group write permissions to a scope properly                                                                                           |
| `--external-package-manager`              |                  | enable external package manager mode (npm/yarn/pnpm)                                                                                      |
| `--skip-interactive`                      |                  | skip interactive mode for Git repositories                                                                                                |

---

## install

**Alias**: `in`  
**Description**: install workspace dependencies  
installs workspace dependencies and prepares the workspace for development.  
when packages are specified, adds them to workspace.jsonc policy and installs. when no packages specified, installs existing dependencies.  
automatically imports components, compiles components, links to node_modules, and writes config files.

`bit install [packages...]`

| **Arg**       |                   **Description**                   |
| ------------- | :-------------------------------------------------: |
| `packages...` | a list of packages to install (separated by spaces) |

| **Option**                      | **Option alias** | **Description**                                                                                        |
| ------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------ |
| `--type [lifecycleType]`        |       `-t`       | "runtime" (default) or "peer" (dev is not a valid option)                                              |
| `--update`                      |       `-u`       | update all dependencies to latest version according to their semver range                              |
| `--update-existing`             |                  | DEPRECATED (not needed anymore, it is the default now). update existing dependencies version and types |
| `--save-prefix [savePrefix]`    |                  | set the prefix to use when adding dependency to workspace.jsonc                                        |
| `--skip-dedupe`                 |                  | do not dedupe dependencies on installation                                                             |
| `--skip-import`                 |                  | do not import bit objects post installation                                                            |
| `--skip-compile`                |                  | do not compile components                                                                              |
| `--skip-write-config-files`     |                  | do not write config files (such as eslint, tsconfig, prettier, etc...)                                 |
| `--add-missing-deps`            |       `-a`       | install all missing dependencies                                                                       |
| `--skip-unavailable`            |                  | when adding missing dependencies, skip those that are not found in the regisry                         |
| `--add-missing-peers`           |                  | install all missing peer dependencies                                                                  |
| `--recurring-install`           |                  | automatically run install again if there are non loaded old envs in your workspace                     |
| `--no-optional [noOptional]`    |                  | do not install optional dependencies (works with pnpm only)                                            |
| `--lockfile-only`               |                  | dependencies are not written to node_modules. Only the lockfile is updated                             |
| `--allow-scripts [pkgNames]`    |                  | a comma separated list of package names that are allowed to run installation scripts                   |
| `--disallow-scripts [pkgNames]` |                  | a comma separated list of package names that are NOT allowed to run installation scripts               |

---

## lane

**Alias**: `l`  
**Description**: manage lanes for parallel development  
lanes allow isolated development of features without affecting main branch components.  
create, switch between, and merge lanes to coordinate parallel work across teams.  
without a sub-command, lists all available lanes.

`bit lane [sub-command]`

### lane list

**Usage**: `lane list`

**Description**: list local or remote lanes

| **Option**                     | **Option alias** | **Description**                                               |
| ------------------------------ | :--------------: | ------------------------------------------------------------- |
| `--details`                    |       `-d`       | show more details on the state of each component in each lane |
| `--json`                       |       `-j`       | show lanes' details in a json format                          |
| `--remote <remote-scope-name>` |       `-r`       | show all remote lanes from the specified scope                |
| `--merged`                     |                  | list only merged lanes                                        |
| `--not-merged`                 |                  | list only lanes that haven't been merged                      |

### lane switch

**Usage**: `lane switch <lane>`

**Description**: switch to the specified lane

| **Arg** |                     **Description**                      |
| ------- | :------------------------------------------------------: |
| `lane`  | lane-name or lane-id (if lane is not local) to switch to |

| **Option**                              | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| --------------------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--head`                                |       `-h`       | switch to the head of the lane/main (fetches the latest changes from the remote)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--auto-merge-resolve <merge-strategy>` |       `-r`       | merge local changes with the checked out version. strategy should be "theirs", "ours" or "manual"                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `--force-ours`                          |                  | do not merge, preserve local files as is                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `--force-theirs`                        |                  | do not merge, just overwrite with incoming files                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--get-all`                             |       `-a`       | DEPRECATED. this is currently the default behavior                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `--workspace-only`                      |                  | checkout only the components in the workspace to the selected lane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `--skip-dependency-installation`        |       `-x`       | do not install dependencies of the imported components                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `--pattern <component-pattern>`         |       `-p`       | switch only the lane components matching the specified component-pattern. only works when the workspace is empty component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `--alias <string>`                      |       `-n`       | relevant when the specified lane is a remote lane. create a local alias for the lane (doesnt affect the lane's name on the remote                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `--verbose`                             |                  | display detailed information about components that legitimately were not switched                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `--json`                                |       `-j`       | return the output as JSON                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| `--branch`                              |                  | create and checkout a new git branch named after the lane                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

### lane show

**Usage**: `lane show [lane-name]`

**Description**: show lane details. if no lane specified, show the current lane

| **Option** | **Option alias** | **Description**                                      |
| ---------- | :--------------: | ---------------------------------------------------- |
| `--json`   |       `-j`       | show the lane details in json format                 |
| `--remote` |       `-r`       | show details of the remote head of the provided lane |

### lane create

**Usage**: `lane create <lane-name>`

**Description**: creates a new lane and switches to it  
a lane created from main (default-lane) is empty until components are snapped.  
a lane created from another lane contains all the components of the original lane.

| **Arg**     |      **Description**      |
| ----------- | :-----------------------: |
| `lane-name` | the name for the new lane |

| **Option**                    | **Option alias** | **Description**                                                                                                                                                             |
| ----------------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--scope <scope-name>`        |       `-s`       | remote scope to which this lane will be exported, default to the workspace.json's defaultScope (can be changed up to first export of the lane with "bit lane change-scope") |
| `--remote-scope <scope-name>` |                  | DEPRECATED. use --scope                                                                                                                                                     |
| `--alias <name>`              |                  | a local alias to refer to this lane, defaults to the `<lane-name>` (can be added later with "bit lane alias")                                                               |
| `--fork-lane-new-scope`       |                  | create the new lane in a different scope than its parent lane (if created from another lane)                                                                                |

### lane remove

**Usage**: `lane remove <lanes...>`

**Description**: remove or delete lanes

| **Arg**    |              **Description**              |
| ---------- | :---------------------------------------: |
| `lanes...` | A list of lane names, separated by spaces |

| **Option** | **Option alias** | **Description**                                                                                                                          |
| ---------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `--remote` |       `-r`       | delete a remote lane. use remote/lane-id syntax e.g. bit lane remove owner.org/my-lane --remote. Delete is immediate, no export required |
| `--force`  |       `-f`       | removes/deletes the lane even when the lane is not yet merged to main                                                                    |
| `--silent` |       `-s`       | skip confirmation                                                                                                                        |

### lane change-scope

**Usage**: `lane change-scope <remote-scope-name>`

**Description**: changes the remote scope of a lane  
NOTE: available only before the lane is exported to the remote

| **Option**                | **Option alias** | **Description**                                                                             |
| ------------------------- | :--------------: | ------------------------------------------------------------------------------------------- |
| `--lane-name <lane-name>` |       `-l`       | the name of the lane to change its remote scope. if not specified, the current lane is used |

### lane alias

**Usage**: `lane alias <lane-name> <alias>`

**Description**: adds an alias to a lane  
an alias is a name that can be used locally to refer to a lane. it is saved locally and never reaches the remote.  
it is useful e.g. when having multiple lanes with the same name, but with different remote scopes.

### lane rename

**Usage**: `lane rename <new-name>`

**Description**: change the lane-name locally  
the remote will be updated after the next "bit export" command

| **Option**                | **Option alias** | **Description**                                                            |
| ------------------------- | :--------------: | -------------------------------------------------------------------------- |
| `--lane-name <lane-name>` |       `-l`       | the name of the lane to rename. if not specified, the current lane is used |

### lane diff

**Usage**: `lane diff [values...]`

**Description**: show diff between lanes  
bit lane diff => diff between the current lane and default lane. (only inside workspace).  
bit lane diff to => diff between the current lane (or default-lane when in scope) and "to" lane.  
bit lane diff from to => diff between "from" lane and "to" lane.

| **Arg** |         **Description**          |
| ------- | :------------------------------: |
| `from`  |     base lane for comparison     |
| `to`    | lane being compared to base lane |

| **Option**                      | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--pattern <component-pattern>` |                  | show lane-diff for components conforming to the specified component-pattern only component-pattern format: component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### lane remove-readme

**Usage**: `lane remove-readme [laneName]`

**Description**: DEPRECATED (only use it if you have used add-readme and want to undo it). remove lane readme component

### lane import

**Usage**: `lane import <lane>`

**Description**: import a remote lane to your workspace and switch to that lane

| **Arg** |   **Description**    |
| ------- | :------------------: |
| `lane`  | the remote lane name |

| **Option**                       | **Option alias** | **Description**                                                                                                                        |
| -------------------------------- | :--------------: | -------------------------------------------------------------------------------------------------------------------------------------- |
| `--skip-dependency-installation` |       `-x`       | do not install dependencies of the imported components                                                                                 |
| `--pattern <component-pattern>`  |       `-p`       | import only components from the lane that fit the specified component-pattern to the workspace. works only when the workspace is empty |
| `--branch`                       |                  | create and checkout a new git branch named after the lane                                                                              |

### lane remove-comp

**Usage**: `lane remove-comp <component-pattern>`

**Description**: DEPRECATED. remove components when on a lane

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**         | **Option alias** | **Description**                                                                                   |
| ------------------ | :--------------: | ------------------------------------------------------------------------------------------------- |
| `--workspace-only` |                  | do not mark the components as removed from the lane. instead, remove them from the workspace only |
| `--update-main`    |                  | EXPERIMENTAL. remove, i.e. delete, component/s on the main lane after merging this lane into main |

### lane fetch

**Usage**: `lane fetch [lane-id]`

**Description**: fetch component objects from lanes. if no lane-id is provided, it fetches from the current lane  
note, it does not save the remote lanes objects locally, only the refs

| **Option** | **Option alias** | **Description**        |
| ---------- | :--------------: | ---------------------- |
| `--all`    |       `-a`       | fetch all remote lanes |

### lane eject

**Usage**: `lane eject <component-pattern>`

**Description**: delete a component from the lane and install it as a package from main  
NOTE: unlike "bit eject" on main, this command doesn't only remove the component from the  
workspace, but also mark it as deleted from the lane, so it won't be merged later on.

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### lane history

**Usage**: `lane history [lane-name]`

**Description**: EXPERIMENTAL. show lane history, default to the current lane  
list from the oldest to the newest history items

| **Option**      | **Option alias** | **Description**                        |
| --------------- | :--------------: | -------------------------------------- |
| `--id <string>` |                  | show a specific history item           |
| `--json`        |       `-j`       | return the lane history in json format |

### lane history-diff

**Usage**: `lane history-diff <from-history-id> <to-history-id>`

**Description**: EXPERIMENTAL. show diff between two lane-history ids  
run "bit lane history" to find these history-ids

| **Option**                      | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ------------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--lane <lane-name>`            |       `-l`       | the name of the lane to diff. if not specified, the current lane is used                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `--pattern <component-pattern>` |                  | show lane-diff for components conforming to the specified component-pattern only component-pattern format: component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### lane checkout

**Usage**: `lane checkout <history-id>`

**Description**: EXPERIMENTAL. checkout to a previous history of the current lane. see also "bit lane revert"

| **Arg**      |                            **Description**                            |
| ------------ | :-------------------------------------------------------------------: |
| `history-id` | the history-id to checkout to. run "bit lane history" to list the ids |

| **Option**                       | **Option alias** | **Description**                                           |
| -------------------------------- | :--------------: | --------------------------------------------------------- |
| `--skip-dependency-installation` |       `-x`       | do not install dependencies of the checked out components |

### lane revert

**Usage**: `lane revert <history-id>`

**Description**: EXPERIMENTAL. revert to a previous history of the current lane. see also "bit lane checkout"  
revert is similar to "lane checkout", but it keeps the versions and only change the files.  
choose one or the other based on your needs.  
if you want to continue working on this lane and needs the changes from the history to be the head, then use "lane revert".  
if you want to fork the lane from a certain point in history, use "lane checkout" and create a new lane from it.

| **Arg**      |                            **Description**                            |
| ------------ | :-------------------------------------------------------------------: |
| `history-id` | the history-id to checkout to. run "bit lane history" to list the ids |

| **Option**                       | **Option alias** | **Description**                                               |
| -------------------------------- | :--------------: | ------------------------------------------------------------- |
| `--skip-dependency-installation` |       `-x`       | do not install dependencies of the checked out components     |
| `--restore-deleted-components`   |                  | restore components that were deleted after this history point |
| `--json`                         |       `-j`       | return the revert result in json format                       |

### lane merge

**Usage**: `lane merge <lane> [pattern]`

**Description**: merge a local or a remote lane to the current lane  
by default, the provided lane will be fetched from the remote before merging.  
to merge the lane from the local scope without updating it first, use "--skip-fetch" flag.

when the current and merge candidate lanes are diverged in history and the files could be merged with no conflicts,  
these components will be snap-merged to complete the merge. use "no-auto-snap" to opt-out, or "tag" to tag instead.

when the components are not diverged in history, and the current lane is behind the merge candidate, the merge will  
simply update the components and the heads according to the merge candidate.  
to opt-out, use "--no-snap", the components will be written as the merge candidate, and will be left as modified.

in case a component in both ends don't share history (no snap is found in common), the merge will require "--resolve-unrelated" flag.  
this flag keeps the history of one end and saves a reference to the other end. the decision of which end to keep is determined by the following:

1. if the component exists on main, then the history linked to main will be kept.  
   in this case, the strategy of "--resolve-unrelated" only determines which source-code to keep. it's not about the history.
2. if the component doesn't exist on main, then by default, the history of the current lane will be kept.  
   unless "--resolve-unrelated" is set to "theirs", in which case the history of the other lane will be kept.
3. a. an edge case: if the component is deleted on the current lane, the strategy will always be "theirs".  
   so then the history (and the source-code) of the other lane will be kept.

| **Arg**   |                                                                                                                                                                                                                                                                         **Description**                                                                                                                                                                                                                                                                         |
| --------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `lane`    |                                                                                                                                                                                                                                               lane-name or full lane-id (if remote) to merge to the current lane                                                                                                                                                                                                                                                |
| `pattern` | partially merge the lane - only components that match the specified component-pattern Component pattern format: component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                              | **Option alias** | **Description**                                                                                                                                             |
| --------------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--manual`                              |                  | same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers                                                 |
| `--auto-merge-resolve <merge-strategy>` |       `-r`       | in case of a merge conflict, resolve according to the provided strategy: [ours, theirs, manual]                                                             |
| `--ours`                                |                  | DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep local modifications                                                                       |
| `--theirs`                              |                  | DEPRECATED. use --auto-merge-resolve. in case of a conflict, override local with incoming changes                                                           |
| `--workspace`                           |                  | merge only lane components that are in the current workspace                                                                                                |
| `--no-auto-snap`                        |                  | do not auto snap after merge completed without conflicts of diverged components (see command description)                                                   |
| `--no-snap`                             |                  | do not pass snaps from the other lane even for non-diverged components (see command description)                                                            |
| `--tag`                                 |                  | auto-tag all lane components after merging into main (or tag-merge in case of snap-merge)                                                                   |
| `--build`                               |                  | in case of snap during the merge, run the build-pipeline (similar to bit snap --build)                                                                      |
| `--loose`                               |                  | relevant for --build, to allow build to succeed even if tasks like tests or lint fail                                                                       |
| `--message <message>`                   |       `-m`       | override the default message for the auto snap                                                                                                              |
| `--keep-readme`                         |                  | skip deleting the lane readme component after merging                                                                                                       |
| `--no-squash`                           |                  | relevant for merging lanes into main, which by default squashes all lane snaps                                                                              |
| `--squash`                              |                  | relevant for merging a lane into another non-main lane, which by default does not squash                                                                    |
| `--ignore-config-changes`               |                  | allow merging when components are modified due to config changes (such as dependencies) only and not files                                                  |
| `--verbose`                             |                  | display detailed information about components that were legitimately unmerged                                                                               |
| `--skip-dependency-installation`        |       `-x`       | do not install dependencies of the imported components                                                                                                      |
| `--skip-fetch`                          |                  | use the local state of target-lane if exits locally, without updating it from the remote                                                                    |
| `--include-deps`                        |                  | relevant for "pattern" and "--workspace". merge also dependencies of the specified components                                                               |
| `--resolve-unrelated [merge-strategy]`  |                  | relevant when a component on a lane and the component on main have nothing in common. merge-strategy can be "ours" (default) or "theirs"                    |
| `--include-non-lane-comps`              |                  | DEPRECATED (this is now the default). when merging main, include workspace components that are not on the lane (by default only lane components are merged) |
| `--exclude-non-lane-comps`              |                  | when merging main into a lane, exclude workspace components that are not on the lane (by default all workspace components are merged)                       |
| `--detach-head`                         |                  | UNSUPPORTED YET. for each component, find the divergent point from main and merge to that point. do not change the head                                     |

### lane merge-abort

**Usage**: `lane merge-abort`

**Description**: abort the recent lane-merge. revert the lane object and checkout accordingly  
restore the lane-object to its state before the last "bit lane merge" command.  
also, checkout the workspace components according to the restored lane state

| **Option**                       | **Option alias** | **Description**                                          |
| -------------------------------- | :--------------: | -------------------------------------------------------- |
| `--verbose`                      |                  | show details of components that didn't need to be merged |
| `--silent`                       |       `-s`       | skip confirmation                                        |
| `--skip-dependency-installation` |       `-x`       | do not install packages of the imported components       |

### lane merge-move

**Usage**: `lane merge-move <new-lane-name>`

**Description**: EXPERIMENT. move the current merge state into a new lane. the current lane will be reset  
this command is useful when you got a messy merge state that from one hand you don't want  
to loose the changes, but on the other hand, you want to keep your lane without those changes.  
this command does the following:

1. create a new lane with the current merge state. including all the filesystem changes. (in practice, it leaves the fs intact)
2. reset the current lane to the state before the merge. so then once done with the new lane, you can switch to the current lane and it'll be clean.

| **Option**             | **Option alias** | **Description**                                                                                                                                                             |
| ---------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--scope <scope-name>` |       `-s`       | remote scope to which this lane will be exported, default to the workspace.json's defaultScope (can be changed up to first export of the lane with "bit lane change-scope") |

| **Option**                     | **Option alias** | **Description**                                               |
| ------------------------------ | :--------------: | ------------------------------------------------------------- |
| `--details`                    |       `-d`       | show more details on the state of each component in each lane |
| `--json`                       |       `-j`       | show lanes details in json format                             |
| `--remote <remote-scope-name>` |       `-r`       | show all remote lanes from the specified scope                |
| `--merged`                     |                  | list only merged lanes                                        |
| `--not-merged`                 |                  | list only lanes that haven't been merged                      |

---

## link

**Description**: create links between components and node_modules  
creates links in node_modules for workspace components and core aspects, enabling import resolution.  
automatically links all workspace components and Bit's core aspects to their respective package names.  
useful for development when components need to reference each other or when debugging linking issues.

`bit link [component-names...]`

| **Arg**              |            **Description**             |
| -------------------- | :------------------------------------: |
| `component-names...` | names or IDs of the components to link |

| **Option**                | **Option alias** | **Description**                                                                                  |
| ------------------------- | :--------------: | ------------------------------------------------------------------------------------------------ |
| `--json`                  |       `-j`       | return the output as JSON                                                                        |
| `--verbose`               |                  | verbose output                                                                                   |
| `--rewire`                |       `-r`       | Replace relative paths with module paths in code (e.g. "../foo" => "@bit/foo")                   |
| `--target <dir>`          |                  | link to an external directory (similar to npm-link) so other projects could use these components |
| `--skip-fetching-objects` |                  | skip fetch missing objects from remotes before linking                                           |
| `--peers`                 |                  | link peer dependencies of the components too                                                     |
| `--comp-summary`          |                  | show only a summary of component links instead of listing all components                         |

---

## lint

**Description**: analyze component code for issues and style violations  
runs linters configured by each component's environment (ESLint, etc.) to check for code quality issues.  
by default lints all components. use --changed to lint only new and modified components.  
supports automatic fixing of certain issues with --fix flag.

`bit lint [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**             | **Option alias** | **Description**                                                   |
| ---------------------- | :--------------: | ----------------------------------------------------------------- |
| `--changed`            |       `-c`       | lint only new and modified components                             |
| `--fix`                |       `-f`       | automatically fix problems                                        |
| `--fix-type <fixType>` |                  | specify the types of fixes to apply (problem, suggestion, layout) |
| `--json`               |       `-j`       | return the lint results in json format                            |

---

## list

**Alias**: `ls`  
**Description**: display components in workspace or remote scope  
shows components in the current workspace by default, or from a specified remote scope.  
supports filtering by scope, namespace, and various display options.  
use --outdated to highlight components that have newer versions available.

`bit list [remote-scope]`

| **Option**             | **Option alias** | **Description**                                                                               |
| ---------------------- | :--------------: | --------------------------------------------------------------------------------------------- |
| `--ids`                |       `-i`       | show only component ids, unformatted                                                          |
| `--local-scope`        |       `-l`       | show only components stored in the local scope, including indirect dependencies               |
| `--scope <string>`     |       `-s`       | filter components by their scope name (e.g., teambit.workspace)                               |
| `--outdated`           |       `-o`       | highlight outdated components, in comparison with their latest remote version (if one exists) |
| `--include-deleted`    |       `-d`       | EXPERIMENTAL. show also deleted components                                                    |
| `--json`               |       `-j`       | show the output in JSON format                                                                |
| `--namespace <string>` |       `-n`       | filter components by their namespace (a logical grouping within a scope, e.g., 'ui', '\*/ui') |

---

## local-only

**Description**: manage components that exist only in the workspace  
controls components that are excluded from versioning (snap/tag) and exporting operations.  
local-only components are useful for workspace-specific tools, configs, or temporary components.  
these components remain in the workspace but won't be shared or versioned.

`bit local-only <sub-command>`

### local-only set

**Usage**: `local-only set <component-pattern>`

**Description**: set a component as local-only

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### local-only unset

**Usage**: `local-only unset <component-pattern>`

**Description**: remove a component from local-only

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### local-only list

**Usage**: `local-only list`

**Description**: list all local-only components

---

## log

**Description**: display component version history  
shows chronological history of component versions including tags and snaps with metadata.  
displays commit messages, authors, dates, and version information. supports both local and remote component logs.  
use various format options for compact or detailed views of version history.

`bit log <id>`

| **Arg** |        **Description**         |
| ------- | :----------------------------: |
| `id`    | component-id or component-name |

| **Option**       | **Option alias** | **Description**                                                                                           |
| ---------------- | :--------------: | --------------------------------------------------------------------------------------------------------- |
| `--remote`       |       `-r`       | show log of a remote component                                                                            |
| `--parents`      |                  | show parents and lanes data                                                                               |
| `--one-line`     |       `-o`       | show each log entry in one line                                                                           |
| `--full-hash`    |       `-f`       | show full hash of the snap (default to the first 9 characters for --one-line/--parents flags)             |
| `--full-message` |       `-m`       | show full message of the snap (default to the first line for --one-line/--parents flags)                  |
| `--show-hidden`  |                  | show hidden snaps (snaps are marked as hidden typically when the following tag has the same files/config) |
| `--json`         |       `-j`       | json format                                                                                               |

---

## log-file

**Description**: EXPERIMENTAL. display history of changes to a specific file  
shows version history for a specific file within component versions.  
tracks file-level changes across component snaps and tags.  
displays file modifications, hashes, and associated commit information.

`bit log-file <filepath>`

| **Arg**    |           **Description**           |
| ---------- | :---------------------------------: |
| `filepath` | file path relative to the workspace |

| **Option**   | **Option alias** | **Description**                 |
| ------------ | :--------------: | ------------------------------- |
| `--one-line` |       `-o`       | show each log entry in one line |

---

## login

**Description**: authenticate with Bit Cloud for component publishing and collaboration  
opens browser to authenticate with Bit Cloud (bit.cloud) and obtain access token for publishing components.  
automatically updates .npmrc file with registry configuration and authentication token for seamless package publishing.  
supports custom cloud domains, CI/machine authentication, and manual token refresh options.

`bit login`

| **Option**                  | **Option alias** | **Description**                                                                                      |
| --------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------- |
| `--skip-config-update`      |                  | skip writing to the .npmrc file                                                                      |
| `--refresh-token`           |                  | force refresh token even when logged in                                                              |
| `--cloud-domain <domain>`   |       `-d`       | login cloud domain (default bit.cloud)                                                               |
| `--default-cloud-domain`    |                  | login to default cloud domain (bit.cloud)                                                            |
| `--port <port>`             |       `-p`       | port number to open for localhost server (default 8085)                                              |
| `--no-browser`              |                  | do not open a browser for authentication                                                             |
| `--machine-name <name>`     |                  | specify machine-name to pair with the token (useful for CI to avoid accidentally revoking the token) |
| `--suppress-browser-launch` |                  | DEPRECATE. use --no-browser instead                                                                  |

---

## logout

**Description**: sign out of Bit Cloud and clear authentication tokens  
removes stored authentication tokens and signs out of Bit Cloud.  
clears local credentials while preserving .npmrc configurations.  
use this to switch between accounts or when authentication tokens expire.

`bit logout`

---

## mcp-server

**Description**: start Model Context Protocol server for AI assistants  
enables AI assistants and other tools to interact with Bit via the Model Context Protocol.  
provides a standardized interface for AI agents to execute Bit commands and access component information.  
allows writing custom instructions and rules to guide AI agents in their interactions with Bit.

`bit mcp-server [sub-command]`

### mcp-server start

**Usage**: `mcp-server start`

**Description**: Start the MCP server  
Start the Model Context Protocol (MCP) server with the specified configuration

| **Option**                        | **Option alias** | **Description**                                                                                                           |
| --------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------- |
| `--include-additional <commands>` |                  | Add specific commands to the default MCP tools set. Use comma-separated list in quotes                                    |
| `--bit-bin <binary>`              |                  | Specify the binary to use for running Bit commands (default: "bit")                                                       |
| `--consumer-project`              |                  | For non-Bit workspaces that only consume Bit component packages. Enables only "schema", "show", and "remote_search" tools |

### mcp-server setup

**Usage**: `mcp-server setup [editor]`

**Description**: Setup MCP integration with VS Code, Cursor, Windsurf, Roo Code, Cline, Claude Code, or other editors  
Creates or updates configuration files to integrate Bit MCP server with supported editors. Currently supports VS Code, Cursor, Windsurf, Roo Code, Cline, and Claude Code.

| **Arg**  |                                         **Description**                                         |
| -------- | :---------------------------------------------------------------------------------------------: |
| `editor` | Editor to setup (default: vscode). Available: vscode, cursor, windsurf, roo, cline, claude-code |

| **Option**                        | **Option alias** | **Description**                                                                        |
| --------------------------------- | :--------------: | -------------------------------------------------------------------------------------- |
| `--consumer-project`              |                  | Configure for non-Bit workspaces that only consume Bit component packages              |
| `--include-additional <commands>` |                  | Add specific commands to the default MCP tools set. Use comma-separated list in quotes |
| `--global`                        |       `-g`       | Setup global configuration (default: workspace-specific)                               |

### mcp-server rules

**Usage**: `mcp-server rules [editor]`

**Description**: Write Bit MCP rules/instructions file for VS Code, Cursor, Roo Code, Cline, Claude Code, or print to screen  
Creates or updates rules/instructions markdown files to provide AI assistants with guidance on using Bit MCP server. Currently supports VS Code, Cursor, Roo Code, Cline, and Claude Code. For Claude Code, creates .claude/bit.md to avoid overwriting existing CLAUDE.md files. Use --print to display content on screen. Use --consumer-project for non-Bit workspaces that only consume components as packages. Use --force-standard to use standard Bit rules instead of Git-integrated template.

| **Arg**  |                                         **Description**                                         |
| -------- | :---------------------------------------------------------------------------------------------: |
| `editor` | Editor to write rules for (default: vscode). Available: vscode, cursor, roo, cline, claude-code |

| **Option**           | **Option alias** | **Description**                                                                            |
| -------------------- | :--------------: | ------------------------------------------------------------------------------------------ |
| `--global`           |       `-g`       | Write rules to global configuration (default: workspace-specific)                          |
| `--print`            |       `-p`       | Print rules content to screen instead of writing to file                                   |
| `--consumer-project` |                  | Generate rules for consumer projects that only use Bit components as packages              |
| `--force-standard`   |                  | Use standard Bit rules template instead of Git-integrated template (even when .git exists) |

| **Option**                        | **Option alias** | **Description**                                                                                                           |
| --------------------------------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------- |
| `--include-additional <commands>` |                  | Add specific commands to the default MCP tools set. Use comma-separated list in quotes                                    |
| `--bit-bin <binary>`              |                  | Specify the binary to use for running Bit commands (default: "bit")                                                       |
| `--consumer-project`              |                  | For non-Bit workspaces that only consume Bit component packages. Enables only "schema", "show", and "remote_search" tools |

---

## merge

**Description**: merge diverged component history when local and remote have different versions  
resolves diverged component history when both local and remote have created different snaps/tags from the same base version.  
if no component pattern is specified, all pending-merge components will be merged (run 'bit status' to list them).  
'bit status' will show diverged components and suggest either merging or resetting local changes.  
preferred approach: use 'bit reset' to remove local versions, then 'bit checkout head' to get remote versions.  
for lane-to-lane merging, use 'bit lane merge' instead.

`bit merge [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                              | **Option alias** | **Description**                                                                                                         |
| --------------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------- |
| `--ours`                                |                  | DEPRECATED. use --auto-merge-resolve. in case of a conflict, keep the local modification                                |
| `--theirs`                              |                  | DEPRECATED. use --auto-merge-resolve. in case of a conflict, override the local modification with the specified version |
| `--manual`                              |                  | same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers             |
| `--auto-merge-resolve <merge-strategy>` |       `-r`       | in case of a conflict, resolve according to the strategy: [ours, theirs, manual]                                        |
| `--abort`                               |                  | in case of an unresolved merge, revert to pre-merge state                                                               |
| `--resolve`                             |                  | mark an unresolved merge as resolved and create a new snap with the changes                                             |
| `--no-snap`                             |                  | do not auto snap even if the merge completed without conflicts                                                          |
| `--build`                               |                  | in case of snap during the merge, run the build-pipeline (similar to bit snap --build)                                  |
| `--verbose`                             |                  | show details of components that were not merged successfully                                                            |
| `--skip-dependency-installation`        |       `-x`       | do not install new dependencies resulting from the merge                                                                |
| `--message <message>`                   |       `-m`       | override the default message for the auto snap                                                                          |

---

## move

**Alias**: `mv`  
**Description**: relocate a component to a different directory  
moves component files to a new location within the workspace and updates the .bitmap tracking.  
only changes the filesystem location - does not affect the component's name, scope, or ID.  
useful for reorganizing workspace structure or following new directory conventions.

`bit move <current-component-dir> <new-component-dir>`

| **Arg**                 |                                        **Description**                                         |
| ----------------------- | :--------------------------------------------------------------------------------------------: |
| `current-component-dir` |               the component's current directory (relative to the workspace root)               |
| `new-component-dir`     | the new directory (relative to the workspace root) to create and move the component's files to |

---

## new

**Description**: create a new Bit workspace from a template  
initializes a new Bit workspace with pre-configured settings, environments, and optionally starter components.  
templates provide different setups for React, Angular, Node.js, or custom development workflows.  
installs dependencies and configures the workspace for immediate development.

`bit new <template-name> <workspace-name>`

| **Arg**          |                                                        **Description**                                                         |
| ---------------- | :----------------------------------------------------------------------------------------------------------------------------: |
| `template-name`  | the name of the workspace template (run 'bit templates' outside of a workspace to get a list of available workspace templates) |
| `workspace-name` |                          the name for the new workspace and workspace directory that will be created                           |

| **Option**                       | **Option alias** | **Description**                                                                                                                     |
| -------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------- |
| `--aspect <aspect-id>`           |       `-a`       | id of the aspect that registered the template, mandatory for non-core aspects. helpful for core aspects in case of a name collision |
| `--template <env-id>`            |       `-t`       | id of the dev environment to use for the template. Alias for --env.                                                                 |
| `--env <env-id>`                 |                  | id of the dev environment to use for the template. Alias -t                                                                         |
| `--default-scope <scope-name>`   |       `-d`       | set the default scope for the workspace. used in the generated workspace.jsonc                                                      |
| `--standalone`                   |                  | DEPRECATED. use --skip-git instead                                                                                                  |
| `--skip-git`                     |       `-s`       | skip generation of Git repository in the new workspace                                                                              |
| `--empty`                        |       `-e`       | skip template's default component creation (relevant for templates that add components by default)                                  |
| `--load-from <path-to-template>` |                  | local path to the workspace containing the template. Helpful during a development of a workspace-template                           |
| `--current-dir`                  |       `-c`       | create the new workspace in current directory (default is to create a new directory, inside the current dir)                        |

---

## npmrc

**Description**: configure .npmrc file with Bit Cloud registry and authentication settings  
manages .npmrc configuration for seamless package installation from Bit Cloud registries.  
automatically configures scoped registries and authentication tokens for your workspace components.  
provides sub-commands for generating, updating, and managing npm registry configurations.

`bit npmrc [sub-command]`

### npmrc generate

**Usage**: `npmrc generate`

**Description**: update npmrc file with scope, registry, and token information from bit.cloud

| **Option**  | **Option alias** | **Description**                                          |
| ----------- | :--------------: | -------------------------------------------------------- |
| `--dry-run` |                  | show the .npmrc file content that will be written        |
| `--force`   |       `-f`       | force update the .npmrc file even if there are conflicts |

---

## pattern

**Description**: test and validate component patterns  
this command helps validating a pattern before using it in other commands.  
NOTE: always wrap the pattern with quotes to avoid collision with shell commands. depending on your shell, it might be single or double quotes.  
a pattern can be a simple component-id or component-name. e.g. 'ui/button'.  
a pattern can be used with wildcards for multiple component ids, e.g. 'org.scope/utils/**' or '**/utils/**' to capture all org/scopes.  
to enter multiple patterns, separate them by a comma, e.g. 'ui/_, lib/_'  
to exclude, use '!'. e.g. 'ui/**, !ui/button'  
the matching algorithm is from multimatch (@see https://github.com/sindresorhus/multimatch).

to filter by a state or attribute, prefix the pattern with "$". e.g. '$deprecated', '$modified'.  
list of supported states: [new, modified, deprecated, deleted, snappedOnMain, softTagged, codeModified, localOnly].  
to filter by multi-params state/attribute, separate the params with ":", e.g. '$env:teambit.react/react'.  
list of supported multi-params states: [env].  
to match a state and another criteria, use " AND " keyword. e.g. '$modified AND teambit.workspace/\*\* AND $env:teambit.react/react'.

`bit pattern <pattern>`

| **Option** | **Option alias** | **Description**                                                                           |
| ---------- | :--------------: | ----------------------------------------------------------------------------------------- |
| `--json`   |       `-j`       | return the output as JSON                                                                 |
| `--remote` |       `-r`       | query a remote scope (the pattern must start with the scope name, e.g. "scope-name/\*\*") |

---

## recover

**Description**: restore soft-deleted components  
reverses the soft-deletion of components marked with "bit delete", restoring them to their previous state. works for both local and remote soft-deleted components. supports patterns like "comp1", "org.scope/\*", etc.

`bit recover <component-pattern>`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                       | **Option alias** | **Description**                                                        |
| -------------------------------- | :--------------: | ---------------------------------------------------------------------- |
| `--skip-dependency-installation` |       `-x`       | do not install packages in case of importing components                |
| `--skip-write-config-files`      |                  | do not write config files (such as eslint, tsconfig, prettier, etc...) |

---

## refactor

**Description**: automatically refactor component source code  
performs automated code transformations and refactoring operations across components.  
currently supports updating import/require statements when component names or dependencies change.  
useful for maintaining code consistency after renaming or restructuring components.

`bit refactor <sub-command>`

### refactor dependency-name

**Usage**: `refactor dependency-name <old-id> <new-id>`

**Description**: replace the dependency's old package-name with a new one in the code  
the `<old-id>` and `<new-id>` arguments can be either a component-id or a package-name.

---

## remote

**Description**: manage remote scopes for self-hosted environments  
configure connections to self-hosted remote scopes via HTTP or file protocol.  
note: this command is only needed for self-hosted scopes. when using bit.cloud, remote scopes are automatically configured.  
remotes are bare scopes that store exported components and enable collaboration across teams.

`bit remote`

### remote add

**Usage**: `remote add <url>`

**Description**: add a bare-scope as a remote  
supported protocols are [file, http].  
for example: "http://localhost:3000", "file:///tmp/local-scope"

| **Option** | **Option alias** | **Description**              |
| ---------- | :--------------: | ---------------------------- |
| `--global` |       `-g`       | configure a remote bit scope |

### remote del

**Usage**: `remote del <name>`

**Description**: remove a tracked bit remote

| **Option** | **Option alias** | **Description**                           |
| ---------- | :--------------: | ----------------------------------------- |
| `--global` |       `-g`       | remove a globally configured remote scope |

### remote list

**Usage**: `remote list`

**Description**: list all configured remotes

| **Option** | **Option alias** | **Description**                 |
| ---------- | :--------------: | ------------------------------- |
| `--global` |       `-g`       | see globally configured remotes |

| **Option** | **Option alias** | **Description**                 |
| ---------- | :--------------: | ------------------------------- |
| `--global` |       `-g`       | see globally configured remotes |

---

## remove

**Alias**: `rm`  
**Description**: untrack components from the workspace  
removes components from the local workspace only - stops tracking them in .bitmap and deletes their files by default.  
does not affect remote scopes - to delete components from remotes, use "bit delete" instead.  
use --keep-files to preserve component files while only removing the tracking.

`bit remove <component-pattern>`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**     | **Option alias** | **Description**                                                                                                                                |
| -------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--track`      |       `-t`       | keep tracking component in .bitmap (default = false), helps transform a tagged-component to new                                                |
| `--keep-files` |                  | keep component files (just untrack the component)                                                                                              |
| `--force`      |       `-f`       | removes the component from the scope, even if used as a dependency. WARNING: you will need to fix the components that depend on this component |
| `--silent`     |       `-s`       | skip confirmation                                                                                                                              |

---

## rename

**Description**: change a component name  
renames a component and optionally refactors dependent code to use the new name.  
for exported components: creates a new component with the new name and marks the original as deleted.  
for local components: simply renames the existing component in place.

`bit rename <current-name> <new-name>`

| **Arg**        |                                         **Description**                                          |
| -------------- | :----------------------------------------------------------------------------------------------: |
| `current-name` |                       the current component name (without its scope name)                        |
| `new-name`     | the new component name (without its scope name. use --scope to define the new component's scope) |

| **Option**               | **Option alias** | **Description**                                                                                                                                        |
| ------------------------ | :--------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--scope <scope-name>`   |       `-s`       | define the scope for the new component                                                                                                                 |
| `--refactor`             |       `-r`       | update the import/require statements in all dependent components (in the same workspace)                                                               |
| `--preserve`             |                  | avoid renaming files and variables/classes according to the new component name                                                                         |
| `--ast`                  |                  | use ast to transform files instead of regex                                                                                                            |
| `--delete`               |                  | DEPRECATED. this is now the default                                                                                                                    |
| `--deprecate`            |                  | instead of deleting the original component, deprecating it                                                                                             |
| `--path <relative-path>` |       `-p`       | relative path in the workspace to place new component in. by default, the directory of the new component is from your workspace's "defaultScope" value |

---

## reset

**Description**: revert local tags and snaps to previous versions  
removes local component versions (tags/snaps) that haven't been exported yet.  
if no component-pattern is provided, resets all components (with confirmation prompt).  
by default reverts all local versions of each component. use --head to revert only the latest version.  
useful for undoing mistakes before exporting. exported versions cannot be reset.

`bit reset [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**         | **Option alias** | **Description**                                                                                                 |
| ------------------ | :--------------: | --------------------------------------------------------------------------------------------------------------- |
| `--all`            |       `-a`       | DEPRECATED. this is now the default behavior when no component-pattern is provided                              |
| `--head`           |                  | revert the head tag/snap only (by default, all local tags/snaps are reverted)                                   |
| `--soft`           |                  | revert only soft-tags (components tagged with --soft flag)                                                      |
| `--force`          |       `-f`       | revert the tag even if it's used as a dependency. WARNING: components that depend on this tag will be corrupted |
| `--never-exported` |                  | reset only components that were never exported                                                                  |
| `--silent`         |       `-s`       | skip confirmation when resetting all components                                                                 |

---

## revert

**Description**: replace component files with specified version while preserving current version  
replaces component source files with files from the specified version but keeps the current component version.  
useful for reverting file changes without changing the component's version history. different from checkout which changes the version.

`bit revert <component-pattern> <to>`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `to`                |                                                                                                                                                                                   permitted values: [main, specific-version]. 'main' - head version on main.                                                                                                                                                                                    |

| **Option**                       | **Option alias** | **Description**                                    |
| -------------------------------- | :--------------: | -------------------------------------------------- |
| `--verbose`                      |       `-v`       | showing verbose output for inspection              |
| `--skip-dependency-installation` |       `-x`       | do not install packages of the imported components |

---

## run

**Alias**: `c`  
**Description**: start an application component locally  
runs application components in their own development server, separate from the "bit start" UI.  
apps are components that create deployable applications (React apps, Node.js servers, etc.).  
when no app name is specified, automatically detects and runs the app if only one exists in the workspace.

`bit run [app-name]`

| **Arg**    |                                           **Description**                                            |
| ---------- | :--------------------------------------------------------------------------------------------------: |
| `app-name` | the app's name is registered by the app (run 'bit app list' to list the names of the available apps) |

| **Option**             | **Option alias** | **Description**                                                                                                                               |
| ---------------------- | :--------------: | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `--dev`                |       `-d`       | start the application in dev mode.                                                                                                            |
| `--port [port-number]` |       `-p`       | port to run the app on                                                                                                                        |
| `--verbose`            |       `-v`       | show verbose output for inspection and print stack trace                                                                                      |
| `--watch`              |       `-w`       | watch and compile your components upon changes                                                                                                |
| `--no-browser`         |       `-n`       | do not automatically open browser when ready                                                                                                  |
| `--args <argv>`        |       `-a`       | the arguments passing to the app. for example, --args="--a=1 --b". don't forget to use quotes to wrap the value to escape special characters. |

---

## schema

**Description**: display component API schema and type definitions  
extracts and displays the public API structure of components including types, functions, classes, and interfaces.  
shows detailed type information, function signatures, and JSDoc documentation for exported elements.  
useful for understanding component interfaces and generating documentation.

you can use a `<pattern>` for multiple component ids, such as `bit schema "org.scope/utils/**"`.  
use comma to separate patterns and '!' to exclude. e.g. 'ui/\*\*, !ui/button'  
use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'.  
always wrap the pattern with single quotes to avoid collision with shell commands.  
use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.

`bit schema <pattern>`

| **Option** | **Option alias** | **Description**                                                        |
| ---------- | :--------------: | ---------------------------------------------------------------------- |
| `--remote` |       `-r`       | fetch schema from remote scope (works for components not in workspace) |
| `--json`   |       `-j`       | return the component schema in json format                             |

---

## scope

**Description**: manage component scope names and assignments  
configure scope assignments for components including setting default scopes and renaming existing scopes.  
scopes determine where components are stored and published, forming the first part of component IDs.  
essential for organizing components and managing component namespaces across teams.

`bit scope <sub-command>`

### scope set

**Usage**: `scope set <scope-name> [component-pattern]`

**Description**: Sets the scope for specified component/s. If no component is specified, sets the default scope of the workspace  
default scopes for components are set in the bitmap file. the default scope for a workspace is set in the workspace.jsonc.  
a component is set with a scope (as oppose to default scope) only once it is versioned.'

you can use a `<pattern>` for multiple component ids, such as `bit scope set scope-name "org.scope/utils/**"`.  
use comma to separate patterns and '!' to exclude. e.g. 'ui/\*\*, !ui/button'  
use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'.  
always wrap the pattern with single quotes to avoid collision with shell commands.  
use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `scope-name`        |                                                                                                                                                                                                            name of the scope to set                                                                                                                                                                                                             |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

### scope rename

**Usage**: `scope rename <current-scope-name> <new-scope-name>`

**Description**: rename the scope name for all components with the specified 'current scope name'. if exported, create new components and delete the original ones  
Note: if `<current-scope-name>` is also the defaultScope for the workspace, this command will set `<new-scope-name>`  
as the defaultScope instead, and that will then be set for all components by default. You may see updates in your .bitmap file  
as a result of this change

| **Arg**              |                   **Description**                   |
| -------------------- | :-------------------------------------------------: |
| `current-scope-name` | the scope name to be replaced by another scope name |
| `new-scope-name`     | a new scope name to replace the current scope name  |

| **Option**    | **Option alias** | **Description**                                                                                                 |
| ------------- | :--------------: | --------------------------------------------------------------------------------------------------------------- |
| `--preserve`  |                  | avoid renaming files and variables/classes according to the new scope name                                      |
| `--refactor`  |       `-r`       | update the import statements in all dependent components to the new package name (i.e. with the new scope name) |
| `--deprecate` |                  | for exported components, instead of deleting the original components, deprecating them                          |

### scope rename-owner

**Usage**: `scope rename-owner <current-owner-name> <new-owner-name>`

**Description**: Renames the owner part of the scope-name for all components with the specified 'current owner name'

| **Arg**              |                   **Description**                   |
| -------------------- | :-------------------------------------------------: |
| `current-owner-name` | the owner name to be replaced by another owner name |
| `new-owner-name`     | a new owner name to replace the current owner name  |

| **Option**   | **Option alias** | **Description**                                                                                                     |
| ------------ | :--------------: | ------------------------------------------------------------------------------------------------------------------- |
| `--refactor` |       `-r`       | update the import statements in all dependent components to the new package name (that contains the new owner name) |
| `--ast`      |                  | use ast to transform files instead of regex                                                                         |

### scope fork

**Usage**: `scope fork <original-scope> [new-scope] [pattern]`

**Description**: fork all components of the original-scope and refactor the source-code to use the new scope name  
optionally, provide [pattern] to limit the fork to specific components

| **Arg**          |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ---------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `original-scope` |                                                                                                                                                                                                           the original scope to fork                                                                                                                                                                                                            |
| `new-scope`      |                                                                                                                                                                                     the new scope to fork to, default to the default-scope of the workspace                                                                                                                                                                                     |
| `pattern`        | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**                       | **Option alias** | **Description**                                    |
| -------------------------------- | :--------------: | -------------------------------------------------- |
| `--ast`                          |                  | use ast to transform files instead of regex        |
| `--skip-dependency-installation` |       `-x`       | do not install packages of the imported components |

---

## script

**Description**: run a script defined by the environment  
executes custom scripts defined by component environments.  
scripts can be shell commands or JavaScript functions defined in env.scripts().  
runs the script for all components grouped by their environment.  
use --list to see all available scripts.

`bit script [script-name]`

| **Arg**       |                         **Description**                          |
| ------------- | :--------------------------------------------------------------: |
| `script-name` | the name of the script to run (e.g., "generate-svg", "pre-snap") |

| **Option** | **Option alias** | **Description**                                  |
| ---------- | :--------------: | ------------------------------------------------ |
| `--list`   |       `-l`       | list all available scripts from all environments |

---

## set-peer

**Description**: configure component to always be installed as peer dependency  
marks a component to always be treated as a peer dependency when used by other components.  
useful for shared libraries that should be provided by the consuming application.  
the specified version range will be used when adding this component as a peer dependency.

`bit set-peer <component-id> <range>`

| **Arg**        |                              **Description**                               |
| -------------- | :------------------------------------------------------------------------: |
| `component-id` |                    the component to set as always peer                     |
| `range`        | the default range to use for the component, when added to peerDependencies |

---

## show

**Description**: display component metadata, dependencies, and configuration  
shows detailed information about a component including its version, dependencies, environment, and other metadata.  
note: to see file changes made in a specific version, use `bit diff <component> <version> --parent`.

`bit show <component-name>`

| **Arg**          |        **Description**         |
| ---------------- | :----------------------------: |
| `component-name` | component name or component id |

| **Option**  | **Option alias** | **Description**                                                                                  |
| ----------- | :--------------: | ------------------------------------------------------------------------------------------------ |
| `--json`    |       `-j`       | return the component data in json format                                                         |
| `--legacy`  |       `-l`       | use the legacy bit show.                                                                         |
| `--remote`  |       `-r`       | show data for a remote component                                                                 |
| `--browser` |       `-b`       | open the component page in the browser                                                           |
| `--compare` |       `-c`       | legacy-only. compare current file system component to its latest tagged version [default=latest] |

---

## snap

**Description**: create immutable component snapshots for development versions  
creates snapshots with hash-based versions for development and testing. snapshots are immutable and exportable.  
by default snaps only new and modified components. use for development iterations before creating semantic version tags.  
snapshots maintain component history and enable collaboration without formal releases.

`bit snap [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                                                                            **Description**                                                                                                                                                                                                                                                                            |
| ------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.. By default, only new and modified components are snapped (add --unmodified to snap all components in the workspace). |

| **Option**                 | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| -------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--message <message>`      |       `-m`       | snap message describing the latest changes - will appear in component history log                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `--unmodified`             |       `-u`       | include unmodified components (by default, only new and modified components are snapped)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `--unmerged`               |                  | complete a merge process by snapping the unmerged components                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--build`                  |       `-b`       | locally run the build pipeline (i.e. not via rippleCI) and complete the snap                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--editor [editor]`        |                  | open an editor to write a snap message per component. optionally specify the editor-name (defaults to vim).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `--skip-tests`             |                  | skip running component tests during snap process                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `--skip-tasks <string>`    |                  | skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes. specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--skip-auto-snap`         |                  | skip auto snapping dependents                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `--disable-snap-pipeline`  |                  | skip the snap pipeline. this will for instance skip packing and publishing component version for install, and app deployment                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--ignore-build-errors`    |                  | proceed to snap pipeline even when build pipeline fails                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--loose`                  |                  | allow snap --build to succeed even if tasks like tests or lint fail                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `--rebuild-deps-graph`     |                  | do not reuse the saved dependencies graph, instead build it from scratch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `--ignore-issues <issues>` |       `-i`       | ignore component issues (shown in "bit status" as "issues found"), issues to ignore: [MissingPackagesDependenciesOnFs, MissingManuallyConfiguredPackages, UntrackedDependencies, ResolveErrors, RelativeComponents, RelativeComponentsAuthored, ParseErrors, MissingDists, LegacyInsideHarmony, MissingDependenciesOnFs, ImportNonMainFiles, MultipleEnvs, MissingLinksFromNodeModulesToSrc, CircularDependencies, DuplicateComponentAndPackage, MergeConfigHasConflict, NonLoadedEnv, ExternalEnvWithoutVersion, RemovedDependencies, RemovedEnv, DeprecatedDependencies, SelfReference, ImportFromDirectory] to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "\*". |
| `--fail-fast`              |                  | stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--detach-head`            |                  | UNSUPPORTED YET. in case a component is checked out to an older version, snap it without changing the head                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

---

## start

**Alias**: `c`  
**Description**: launch the Bit development server  
starts the local development server providing a UI to browse, preview, and interact with components.  
works in both workspaces and scopes. opens automatically in your browser at http://localhost:3000 (or specified port).  
includes hot module reloading for development.

`bit start [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**              | **Option alias** | **Description**                                                                                         |
| ----------------------- | :--------------: | ------------------------------------------------------------------------------------------------------- |
| `--dev`                 |       `-d`       | start UI server in dev mode.                                                                            |
| `--port [port-number]`  |       `-p`       | port of the UI server.                                                                                  |
| `--rebuild`             |       `-r`       | rebuild the UI (useful e.g. when updating the workspace UI - can use the dev flag for HMR in this case) |
| `--skip-ui-build`       |                  | skip building UI                                                                                        |
| `--verbose`             |       `-v`       | show verbose output for inspection and prints stack trace                                               |
| `--no-browser`          |       `-n`       | do not automatically open browser when ready                                                            |
| `--show-internal-urls`  |                  | show urls for all internal dev servers                                                                  |
| `--skip-compilation`    |                  | skip the auto-compilation before starting the web-server                                                |
| `--ui-root-name [type]` |       `-u`       | name of the ui root to use, e.g. "teambit.scope/scope" or "teambit.workspace/workspace"                 |

---

## stash

**Description**: temporarily save and restore component changes  
temporarily stores modified component files without creating versions.  
allows saving work-in-progress changes and switching context, then restoring changes later.

`bit stash <sub-command>`

### stash save

**Usage**: `stash save`

**Description**: stash modified components

| **Option**           | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--pattern`          |       `-p`       | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `--include-new`      |                  | EXPERIMENTAL. by default, only modified components are stashed. use this flag to include new components                                                                                                                                                                                                                                                                                                                                         |
| `--message <string>` |       `-m`       | message to be attached to the stashed components                                                                                                                                                                                                                                                                                                                                                                                                |

### stash load

**Usage**: `stash load [stash-id]`

**Description**: apply the changes according to the stash. if no stash-id provided, it loads the latest stash

| **Option**                              | **Option alias** | **Description**                                                                                             |
| --------------------------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------- |
| `--auto-merge-resolve <merge-strategy>` |       `-r`       | in case of merge conflict, resolve according to the provided strategy: [ours, theirs, manual]               |
| `--manual`                              |                  | same as "--auto-merge-resolve manual". in case of merge conflict, write the files with the conflict markers |
| `--force-ours`                          |                  | do not merge, preserve local files as is                                                                    |
| `--force-theirs`                        |                  | do not merge, just overwrite with incoming files                                                            |

### stash list

**Usage**: `stash list`

**Description**: list stash

| **Option**           | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------- | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--pattern`          |       `-p`       | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |
| `--message <string>` |       `-m`       | message to be attached to the stashed components                                                                                                                                                                                                                                                                                                                                                                                                |

---

## status

**Alias**: `s`  
**Description**: show workspace component status and issues  
displays the current state of all workspace components including new, modified, staged, and problematic components.  
identifies blocking issues that prevent tagging/snapping and provides warnings with --warnings flag.  
essential for understanding workspace health before versioning components.

`bit status`

| **Option**                       | **Option alias** | **Description**                                                                         |
| -------------------------------- | :--------------: | --------------------------------------------------------------------------------------- |
| `--json`                         |       `-j`       | return a json version of the component                                                  |
| `--warnings`                     |       `-w`       | show warnings. by default, only issues that block tag/snap are shown                    |
| `--verbose`                      |                  | show extra data: full snap hashes for staged components, and divergence point for lanes |
| `--lanes`                        |       `-l`       | when on a lane, show updates from main and updates from forked lanes                    |
| `--strict`                       |                  | exit with code 1 if any issues are found (both errors and warnings)                     |
| `--fail-on-error`                |                  | exit with code 1 only when tag/snap blocker issues are found (not warnings)             |
| `--ignore-circular-dependencies` |       `-c`       | do not check for circular dependencies to get the results quicker                       |

---

## system

**Description**: access system-level operations and debugging tools  
provides commands for system-level operations including viewing and tailing debug logs.  
useful for troubleshooting issues and monitoring Bit's internal operations in real-time.

`bit system <sub-command>`

### system log

**Usage**: `system log`

**Description**: print debug.log to the screen

### system tail-log

**Usage**: `system tail-log`

**Description**: print the log file to the screen as it is being written  
similar to linux "tail -f" command

---

## tag

**Alias**: `t`  
**Description**: create immutable component snapshots with semantic version tags  
creates tagged versions using semantic versioning (semver) for component releases. tags are immutable and exportable.  
by default tags all new and modified components. supports version specification per pattern using "@" (e.g. foo@1.0.0, bar@minor).  
use for official releases. for development versions, use 'bit snap' instead.

`bit tag [component-patterns...]`

| **Arg**                 |                                                                                                                                                                                                                                        **Description**                                                                                                                                                                                                                                        |
| ----------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-patterns...` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern.. By default, all new and modified are tagged. |

| **Option**                   | **Option alias** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--message <message>`        |       `-m`       | a log message describing latest changes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--unmodified`               |       `-u`       | include unmodified components (by default, only new and modified components are tagged)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--editor [editor]`          |                  | open an editor to write a tag message for each component. optionally, specify the editor-name (defaults to vim).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `--versions-file <path>`     |                  | path to a file containing component versions. format: "component-id: version"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `--ver <version>`            |       `-v`       | tag with the given version                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `--increment <level>`        |       `-l`       | options are: [major, premajor, minor, preminor, patch, prepatch, prerelease], default to patch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| `--prerelease-id <id>`       |                  | prerelease identifier (e.g. "dev" to get "1.0.0-dev.1")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--patch`                    |       `-p`       | syntactic sugar for "--increment patch"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--minor`                    |                  | syntactic sugar for "--increment minor"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--major`                    |                  | syntactic sugar for "--increment major"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| `--pre-release [identifier]` |                  | syntactic sugar for "--increment prerelease" and `--prerelease-id <identifier>`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--snapped`                  |                  | tag only components whose head is a snap (not a tag)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `--unmerged`                 |                  | complete a merge process by tagging the unmerged components                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `--skip-tests`               |                  | skip running component tests during tag process                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--skip-tasks <string>`      |                  | skip the given tasks. for multiple tasks, separate by a comma and wrap with quotes. specify the task-name (e.g. "TypescriptCompiler") or the task-aspect-id (e.g. teambit.compilation/compiler)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--skip-auto-tag`            |                  | skip auto tagging dependents                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| `--soft`                     |                  | do not persist. only keep note of the changes to be made                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `--persist [skip-build]`     |                  | persist the changes generated by --soft tag. by default, run the build pipeline, unless "skip-build" is provided                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| `--disable-tag-pipeline`     |                  | skip the tag pipeline to avoid publishing the components                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `--ignore-build-errors`      |                  | proceed to tag pipeline even when build pipeline fails                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `--rebuild-deps-graph`       |                  | do not reuse the saved dependencies graph, instead build it from scratch                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `--increment-by <number>`    |                  | (default to 1) increment semver flag (patch/minor/major) by. e.g. incrementing patch by 2: 0.0.1 -> 0.0.3.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `--ignore-issues <issues>`   |       `-i`       | ignore component issues (shown in "bit status" as "issues found"), issues to ignore: [MissingPackagesDependenciesOnFs, MissingManuallyConfiguredPackages, UntrackedDependencies, ResolveErrors, RelativeComponents, RelativeComponentsAuthored, ParseErrors, MissingDists, LegacyInsideHarmony, MissingDependenciesOnFs, ImportNonMainFiles, MultipleEnvs, MissingLinksFromNodeModulesToSrc, CircularDependencies, DuplicateComponentAndPackage, MergeConfigHasConflict, NonLoadedEnv, ExternalEnvWithoutVersion, RemovedDependencies, RemovedEnv, DeprecatedDependencies, SelfReference, ImportFromDirectory] to ignore multiple issues, separate them by a comma and wrap with quotes. to ignore all issues, specify "\*". |
| `--ignore-newest-version`    |       `-I`       | allow tagging even when the component has newer versions e.g. for hotfixes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `--fail-fast`                |                  | stop pipeline execution on the first failed task (by default a task is skipped only when its dependency failed)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| `--build`                    |       `-b`       | locally run the build pipeline (i.e. not via rippleCI) and complete the tag                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| `--loose`                    |                  | allow tag --build to succeed even if tasks like tests or lint fail                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| `--detach-head`              |                  | UNSUPPORTED YET. in case a component is checked out to an older version, tag it without changing the head                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |

---

## templates

**Description**: list available templates for creating components and workspaces  
Lists available templates. Inside a workspace it shows component templates for 'bit create'; outside a workspace it shows workspace templates for 'bit new'.

`bit templates`

| **Option**             | **Option alias** | **Description**                          |
| ---------------------- | :--------------: | ---------------------------------------- |
| `--show-all`           |       `-s`       | show hidden templates                    |
| `--aspect <aspect-id>` |       `-a`       | show templates provided by the aspect-id |
| `--json`               |       `-j`       | return templates in json format          |

---

## test

**Alias**: `at`  
**Description**: run component tests  
executes tests using the testing framework configured by each component's environment (Jest, Mocha, etc.).  
by default only runs tests for new and modified components. use --unmodified to test all components.  
supports watch mode, coverage reporting, and debug mode for development workflows.

`bit test [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**             | **Option alias** | **Description**                                                                         |
| ---------------------- | :--------------: | --------------------------------------------------------------------------------------- |
| `--watch`              |       `-w`       | start the tester in watch mode.                                                         |
| `--debug`              |       `-d`       | start the tester in debug mode.                                                         |
| `--all`                |       `-a`       | DEPRECATED. (use --unmodified)                                                          |
| `--unmodified`         |       `-u`       | test all components, not only new and modified                                          |
| `--junit <filepath>`   |                  | write tests results as JUnit XML format into the specified file path                    |
| `--coverage`           |                  | show code coverage data                                                                 |
| `--env <id>`           |       `-e`       | test only components assigned the given env                                             |
| `--update-snapshot`    |                  | if supported by the tester, re-record every snapshot that fails during the test run     |
| `--scope <scope-name>` |       `-s`       | DEPRECATED. (use the pattern instead, e.g. "scopeName/\*\*"). name of the scope to test |
| `--json`               |       `-j`       | return the results in json format                                                       |

---

## undeprecate

**Description**: remove the deprecation status from a component  
reverses the deprecation of a component, removing warnings and allowing normal use again.

`bit undeprecate <id>`

---

## uninstall

**Alias**: `un`  
**Description**: remove dependencies from workspace  
removes specified packages from workspace.jsonc dependency policy and runs install to update node_modules.

`bit uninstall [packages...]`

| **Arg**       |                       **Description**                       |
| ------------- | :---------------------------------------------------------: |
| `packages...` | list of package names to remove from workspace dependencies |

---

## unset-peer

**Description**: remove always-peer configuration from component  
removes the always-peer marking from a component, allowing it to be installed as a regular dependency.  
reverses the effect of 'bit set-peer' command. the component will be treated normally in dependency resolution.

`bit unset-peer <component-id>`

| **Arg**        |            **Description**            |
| -------------- | :-----------------------------------: |
| `component-id` | the component to unset as always peer |

---

## update

**Alias**: `up`  
**Description**: update workspace dependencies to newer versions  
updates dependencies in workspace.jsonc to newer versions and runs install to apply changes.  
by default, updates to highest semver-compatible versions. use --major, --minor, or --patch for specific version types.  
supports glob patterns to update specific packages. prompts for confirmation unless --yes is specified.

`bit update [package-patterns...]`

| **Arg**               |                                                                                       **Description**                                                                                        |
| --------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `package-patterns...` | a string list of package names, or patterns (separated by spaces or commas), e.g. "@teambit/**,@my-org/ui.**". The patterns should be in glob format. By default, all packages are selected. |

| **Option** | **Option alias** | **Description**                                                                                                                                                                |
| ---------- | :--------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--yes`    |       `-y`       | automatically update all outdated versions for packages specified in pattern (all if no pattern supplied) - use carefully as could result in breaking updates for dependencies |
| `--patch`  |                  | update to the latest patch version. Semver rules are ignored                                                                                                                   |
| `--minor`  |                  | update to the latest minor version. Semver rules are ignored                                                                                                                   |
| `--major`  |                  | update to the latest major version. Semver rules are ignored                                                                                                                   |
| `--semver` |                  | update to the newest version respecting semver                                                                                                                                 |

---

## validate

**Description**: run type-checking, linting, and testing in sequence  
validates components by running check-types, lint, and test commands in sequence.  
stops at the first failure and returns a non-zero exit code.  
by default validates only new and modified components. use --all to validate all components.

`bit validate [component-pattern]`

| **Arg**             |                                                                                                                                                                                                                 **Description**                                                                                                                                                                                                                 |
| ------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| `component-pattern` | component name, component id, or component pattern. use component pattern to select multiple components. wrap the pattern with quotes. use comma to separate patterns and "!" to exclude. e.g. "ui/\*\*, !ui/button". use '$' prefix to filter by states/attributes, e.g. '$deprecated', '$modified' or '$env:teambit.react/react'. use `bit pattern --help` to understand patterns better and `bit pattern <pattern>` to validate the pattern. |

| **Option**            | **Option alias** | **Description**                                      |
| --------------------- | :--------------: | ---------------------------------------------------- |
| `--all`               |       `-a`       | validate all components, not only modified and new   |
| `--continue-on-error` |       `-c`       | run all validation checks even when errors are found |

---

## version

**Description**: display the installed Bit version

`bit version`

| **Option** | **Option alias** | **Description**                   |
| ---------- | :--------------: | --------------------------------- |
| `--json`   |       `-j`       | return the version in json format |

---

## watch

**Description**: watch and compile components on file changes  
monitors component files for changes and automatically recompiles them using their environment's configured compiler.  
enables immediate feedback during development by keeping components compiled as you work.  
by default uses file system events (not polling) to minimize CPU usage - enable polling with "bit config set watch_use_polling true" if needed.

`bit watch`

| **Option**               | **Option alias** | **Description**                                                                                                                     |
| ------------------------ | :--------------: | ----------------------------------------------------------------------------------------------------------------------------------- |
| `--verbose`              |       `-v`       | show all watch events and compiler verbose output                                                                                   |
| `--skip-pre-compilation` |                  | skip compilation step before starting to watch                                                                                      |
| `--check-types [string]` |       `-t`       | show errors/warnings for types. options are [file, project] to investigate only changed file or entire project. defaults to project |
| `--import`               |       `-i`       | DEPRECATED. it is now the default. helpful when using git. import component objects if .bitmap changed not by bit                   |
| `--skip-import`          |                  | do not import component objects if .bitmap changed not by bit                                                                       |
| `--generate-types`       |                  | EXPERIMENTAL. generate d.ts files for typescript components (hurts performance)                                                     |
| `--trigger <comp-id>`    |                  | trigger recompilation of the specified component regardless of what changed. helpful when this comp-id must be a bundle             |

---

## whoami

**Description**: display the currently authenticated Bit Cloud user  
shows the username of the currently logged in Bit Cloud account.  
verifies authentication status with the cloud service and displays the active username.  
useful for confirming authentication before publishing or when switching between accounts.

`bit whoami`

---

## why

**Description**: find components that use the specified dependency  
searches workspace components to find which ones depend on the specified package or component.  
useful for understanding dependency usage before removing packages or when refactoring components.  
supports both exact version matching and package name patterns.

`bit why <dependency-name>`

| **Arg**           |                                                               **Description**                                                                |
| ----------------- | :------------------------------------------------------------------------------------------------------------------------------------------: |
| `dependency-name` | package-name. for components, you can use either component-id or package-name. if version is specified, it will search for the exact version |

| **Option**         | **Option alias** | **Description**                           |
| ------------------ | :--------------: | ----------------------------------------- |
| `--depth <number>` |                  | max display depth of the dependency graph |

---

## ws-config

**Alias**: `workspace-config`  
**Description**: generate IDE configuration files  
writes configuration files (tsconfig.json, eslintrc.js, etc.) to your workspace for better IDE support.  
automatically generates configs based on your components' environments and settings.  
useful for enabling proper IntelliSense, linting, and type-checking in your IDE.

`bit ws-config <sub-command>`

### ws-config write

**Usage**: `ws-config write`

**Description**: write config files in the workspace. useful for IDEs

| **Option**               | **Option alias** | **Description**                                                                                                              |
| ------------------------ | :--------------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `--clean`                |       `-c`       | delete existing config files from the workspace. highly recommended to run it with "--dry-run" first                         |
| `--writers <writers>`    |       `-w`       | only write config files for the given writers. use comma to separate multiple writers. use ws-config list to see all writers |
| `--silent`               |       `-s`       | do not prompt for confirmation                                                                                               |
| `--no-dedupe`            |                  | write configs inside each one of the component's dir, avoid deduping                                                         |
| `--dry-run`              |                  | show the paths that configs will be written per env                                                                          |
| `--dry-run-with-content` |                  | use with --json flag. show the config content and the paths that will be written per env                                     |
| `--verbose`              |       `-v`       | showing verbose output for writing                                                                                           |
| `--json`                 |       `-j`       | json format                                                                                                                  |

### ws-config clean

**Usage**: `ws-config clean`

**Description**: clean (delete) written config files in the workspace. useful for IDEs

| **Option**            | **Option alias** | **Description**                                                                                                              |
| --------------------- | :--------------: | ---------------------------------------------------------------------------------------------------------------------------- |
| `--silent`            |       `-s`       | do not prompt for confirmation                                                                                               |
| `--writers <writers>` |       `-w`       | only clean config files for the given writers. use comma to separate multiple writers. use ws-config list to see all writers |
| `--dry-run`           |                  | show the paths of configs that will be cleaned                                                                               |
| `--json`              |       `-j`       | json format                                                                                                                  |

### ws-config list

**Usage**: `ws-config list`

**Description**: list config writers

| **Option** | **Option alias** | **Description** |
| ---------- | :--------------: | --------------- |
| `--json`   |       `-j`       | json format     |

---
